OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [machine/] [powerpc/] [vec_calloc.c] - Blame information for rev 158

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/*
2
FUNCTION
3
<<vec_calloc>>---allocate space for arrays
4
 
5
INDEX
6
        vec_calloc
7
 
8
INDEX
9
        _vec_calloc_r
10
 
11
ANSI_SYNOPSIS
12
        #include <stdlib.h>
13
        void *vec_calloc(size_t <[n]>, size_t <[s]>);
14
        void *vec_calloc_r(void *<[reent]>, size_t <n>, <size_t> <[s]>);
15
 
16
TRAD_SYNOPSIS
17
        #include <stdlib.h>
18
        char *vec_calloc(<[n]>, <[s]>)
19
        size_t <[n]>, <[s]>;
20
 
21
        char *_vec_calloc_r(<[reent]>, <[n]>, <[s]>)
22
        char *<[reent]>;
23
        size_t <[n]>;
24
        size_t <[s]>;
25
 
26
 
27
 
28
DESCRIPTION
29
Use <<vec_calloc>> to request a block of memory sufficient to hold an
30
array of <[n]> elements, each of which has size <[s]>.
31
 
32
The memory allocated by <<vec_calloc>> comes out of the same memory pool
33
used by <<vec_malloc>>, but the memory block is initialized to all zero
34
bytes.  (To avoid the overhead of initializing the space, use
35
<<vec_malloc>> instead.)
36
 
37
The alternate function <<_vec_calloc_r>> is reentrant.
38
The extra argument <[reent]> is a pointer to a reentrancy structure.
39
 
40
RETURNS
41
If successful, a pointer to the newly allocated space.
42
 
43
If unsuccessful, <<NULL>>.
44
 
45
PORTABILITY
46
<<vec_calloc>> is an non-ANSI extension described in the AltiVec Programming
47
Interface Manual.
48
 
49
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
50
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
51
*/
52
 
53
#include <string.h>
54
#include <stdlib.h>
55
 
56
#ifndef _REENT_ONLY
57
 
58
_PTR
59
_DEFUN (vec_calloc, (n, size),
60
        size_t n _AND
61
        size_t size)
62
{
63
  return _vec_calloc_r (_REENT, n, size);
64
}
65
 
66
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.