malloc

Description:

A process calls malloc allocate a block of memory from the free system memory and make it available for memory operations.

Function Prototype:

void * malloc (MEMVAR size, MEMVAR reserve);

Parameters:

size

Specifies the requested size in bytes of the block to be allocated.

reserve

Specifies the size of extra memory to reserve for dynamic memory block resizing using remalloc.

Return Values:

If malloc could successfully allocate the demanded size of memory from the free system memory it will return a pointer to the beginning of the allocated memory block. In case of failure it will return a NULL pointer, the process should then call getlasterror to receive extended inforation on the allocating failure.


See also remalloc, memset, free, getfreemem, getreservedmem, getusedmem, getlasterror