pr_calloc.rst (738B)
1 PR_Calloc 2 ========= 3 4 Allocates zeroed memory from the heap for a number of objects of a given 5 size. 6 7 8 Syntax 9 ------ 10 11 .. code:: 12 13 #include <prmem.h> 14 15 void *PR_Calloc ( 16 PRUint32 nelem, 17 PRUint32 elsize); 18 19 20 Parameters 21 ~~~~~~~~~~ 22 23 ``nelem`` 24 The number of elements of size ``elsize`` to be allocated. 25 ``elsize`` 26 The size of an individual element. 27 28 29 Returns 30 ~~~~~~~ 31 32 An untyped pointer to the allocated memory, or if the allocation attempt 33 fails, ``NULL``. Call ``PR_GetError()`` to retrieve the error returned 34 by the libc function ``malloc()``. 35 36 37 Description 38 ----------- 39 40 This function allocates memory on the heap for the specified number of 41 objects of the specified size. All bytes in the allocated memory are 42 cleared.