HP C/iX Library Reference Manual (30026-90004)
172 Chapter5
HP C/iX Library Function Descriptions
free
free
Frees a block of allocated memory.
Syntax
#include <stdlib.h>
void free (void *
ptr
);
Parameters
ptr
A pointer to a block of memory previously allocated by a call to calloc(),
malloc(), or realloc().
Return Values
None.
Description
The free function frees the block of memory pointed to by
ptr
, making the space available
for further allocation. The contents of the block are destroyed. The argument to free() is a
pointer to a block previously allocated by calloc(), malloc(), or realloc().
The malloc and free functions provide a simple generalized memory allocation package.
Undeļ¬ned results occur if some random pointer is handed to free().
See Also
calloc(), malloc(), realloc(), ANSI C 4.10.3.2, POSIX.1 8.1