free

Description:

free decommitts a block of memory identified by a pointer pointing to the beginning of the block. The memory block receives the owner- PID of a free block. If the block has an additional reserved memory block at its end, the reserved block will be freed also and the two memory blocks will be contingated to one block. The freed block is then available for other processes for memory allocation.

Function Prototype:

int free (void * object);

Parameters:

object

A pointer poiting to the first byte of the memory block to be freed. If the pointer is NULL or invalid (e.g. the respective block is not owned by the calling process) the block freeing will fail and the function returns FALSE. The calling process should call getlasterror to receivce extended information on the failure.

Return Values:

Returns a non-zero value if the freeing was successful. Otherwise it will return a zero value.


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