free(), cfree()

deallocate memory 

Function


SYNOPSIS

#include <stdlib.h>

void free(void *ptr);

void cfree(void *ptr);


DESCRIPTION

The free() function causes the space pointed to by ptr to be deallocated. This space is made available for further allocation. If ptr is a null pointer, no action occurs. Otherwise, if the parameter does not match a pointer that calloc(), malloc(), memalign(), realloc(), or valloc() returned earlier or if free() is handed a random pointer, the behavior is undefined.

The cfree() function behaves identically to free().


PARAMETERS

ptr 

Points to a block of memory previously allocated by calloc(), malloc(), memalign(), realloc(), or valloc().


RETURN VALUES

None.


CONFORMANCE

free(): ANSI/ISO 9899-1990

cfree(): 4.3BSD


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

Do not attempt to use free() to release memory allocated by Win32 heap allocation functions.

In some instances, the free() function causes the block of memory pointed to by ptr to be removed from the address space of the process, and cause any swap space committed for that memory to be released.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
calloc(), malloc(), memalign(), realloc(), valloc()


PTC MKS Toolkit 10.1 patch 1 Documentation Build 2.