source: trunk/libs/newlib/src/newlib/libc/machine/powerpc/vec_calloc.c @ 444

Last change on this file since 444 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
Line 
1/*
2FUNCTION
3<<vec_calloc>>---allocate space for arrays
4
5INDEX
6        vec_calloc
7
8INDEX
9        _vec_calloc_r
10
11SYNOPSIS
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
16DESCRIPTION
17Use <<vec_calloc>> to request a block of memory sufficient to hold an
18array of <[n]> elements, each of which has size <[s]>.
19
20The memory allocated by <<vec_calloc>> comes out of the same memory pool
21used by <<vec_malloc>>, but the memory block is initialized to all zero
22bytes.  (To avoid the overhead of initializing the space, use
23<<vec_malloc>> instead.)
24
25The alternate function <<_vec_calloc_r>> is reentrant.
26The extra argument <[reent]> is a pointer to a reentrancy structure.
27
28RETURNS
29If successful, a pointer to the newly allocated space.
30
31If unsuccessful, <<NULL>>.
32
33PORTABILITY
34<<vec_calloc>> is an non-ANSI extension described in the AltiVec Programming
35Interface Manual.
36
37Supporting 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
46void *
47vec_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.