pr_newzap.rst (630B)
1 PR_NEWZAP 2 ========= 3 4 Allocates and clears memory from the heap for an instance of a given 5 type. 6 7 8 Syntax 9 ------ 10 11 .. code:: 12 13 #include <prmem.h> 14 15 _type * PR_NEWZAP(_struct); 16 17 18 Parameter 19 ~~~~~~~~~ 20 21 ``_struct`` 22 The name of a type. 23 24 25 Returns 26 ~~~~~~~ 27 28 An pointer to a buffer sized to contain the type ``_struct``, or if the 29 allocation attempt fails, ``NULL``. The bytes in the buffer are all 30 initialized to 0. Call ``PR_GetError()`` to retrieve the error returned 31 by the libc function. 32 33 34 Description 35 ----------- 36 37 This macro allocates an instance of the specified type from the heap and 38 sets the content of that memory to zero.