Memory allocation (initialized to zero)
void *calloc(size_t nmemb, size_t size);
When area allocation succeeds, a pointer to that area is returned. When the area could not be allocated, a null pointer is returned.
This function allocates an area for an array of nmemb elements. The allocated area is initialized to zeros.
The memory area management functions automatically allocate memory area as necessary from the heap memory area.
Also, the size of the default is 0x1000 bytes, so when it's changed, the heap memory area must be allocated. The area allocation should be performed first by an application.
#include <stddef.h> #define SIZEOF_HEAP 0x1000 int _REL_sysheap[SIZEOF_HEAP >> 2]; size_t _REL_sizeof_sysheap = SIZEOF_HEAP; |
The variable "_REL_sysheap" points to the starting address of heap memory. This value must be a multiple of 4. |
The required heap memory size (bytes) should be set for the variable "_REL_sizeof_sysheap". |