[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


free

Release previously allocated memory to heap.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <stdlib.h>
void free(void *ptr);
Parameters:

Parameters for this facility are:

ptr  
void *  
A pointer to the allocated memory  

Remarks:

The free() function releases a previously allocated memory block, pointed to by ptr, to the heap. The ptr argument should hold an address returned by the memory allocation functions calloc(), malloc(), or realloc(). Once the memory block ptr points to has been released, it is no longer valid. The ptr variable should not be used to reference memory again until it is assigned a value from the memory allocation functions.

See Also:

"vec_free"

"calloc"

"malloc"

"realloc"

For example of free() usage:
Refer to"Example of calloc() usage." .


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000