Last change
on this file since 690 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.2 KB
|
Rev | Line | |
---|
[444] | 1 | /* |
---|
| 2 | FUNCTION |
---|
| 3 | <<vec_calloc>>---allocate space for arrays |
---|
| 4 | |
---|
| 5 | INDEX |
---|
| 6 | vec_calloc |
---|
| 7 | |
---|
| 8 | INDEX |
---|
| 9 | _vec_calloc_r |
---|
| 10 | |
---|
| 11 | 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 | DESCRIPTION |
---|
| 17 | Use <<vec_calloc>> to request a block of memory sufficient to hold an |
---|
| 18 | array of <[n]> elements, each of which has size <[s]>. |
---|
| 19 | |
---|
| 20 | The memory allocated by <<vec_calloc>> comes out of the same memory pool |
---|
| 21 | used by <<vec_malloc>>, but the memory block is initialized to all zero |
---|
| 22 | bytes. (To avoid the overhead of initializing the space, use |
---|
| 23 | <<vec_malloc>> instead.) |
---|
| 24 | |
---|
| 25 | The alternate function <<_vec_calloc_r>> is reentrant. |
---|
| 26 | The extra argument <[reent]> is a pointer to a reentrancy structure. |
---|
| 27 | |
---|
| 28 | RETURNS |
---|
| 29 | If successful, a pointer to the newly allocated space. |
---|
| 30 | |
---|
| 31 | If unsuccessful, <<NULL>>. |
---|
| 32 | |
---|
| 33 | PORTABILITY |
---|
| 34 | <<vec_calloc>> is an non-ANSI extension described in the AltiVec Programming |
---|
| 35 | Interface Manual. |
---|
| 36 | |
---|
| 37 | Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, |
---|
| 38 | <<lseek>>, <<read>>, <<sbrk>>, <<write>>. |
---|
| 39 | */ |
---|
| 40 | |
---|
| 41 | #include <string.h> |
---|
| 42 | #include <stdlib.h> |
---|
| 43 | |
---|
| 44 | #ifndef _REENT_ONLY |
---|
| 45 | |
---|
| 46 | void * |
---|
| 47 | vec_calloc (size_t n, |
---|
| 48 | size_t size) |
---|
| 49 | { |
---|
| 50 | return _vec_calloc_r (_REENT, n, size); |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.