pr_malloc.rst (516B)
1 PR_MALLOC 2 ========= 3 4 Allocates memory of a specified size from the heap. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prmem.h> 13 14 void * PR_MALLOC(_bytes); 15 16 17 Parameter 18 ~~~~~~~~~ 19 20 ``_bytes`` 21 Size of the requested memory block. 22 23 24 Returns 25 ~~~~~~~ 26 27 An untyped pointer to the allocated memory, or if the allocation attempt 28 fails, ``NULL``. Call ``PR_GetError()`` to retrieve the error returned 29 by the libc function ``malloc()``. 30 31 32 Description 33 ----------- 34 35 This macro allocates memory of the requested size from the heap.