Memory Management

To allocate and deallocate memory blocks, the ANSI library provides the following functions:

Listing: Memory allocation functions


void* malloc(size_t size);
void* calloc(size_t n, size_t size);

void* realloc(void* ptr, size_t size);

void  free(void* ptr);

Because it is not possible to implement these functions in a way that suits all possible target processors and memory configurations, all these functions are based on the system module heap.cfile, which can be modified by the user to fit a particular memory layout.