The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

free - free allocated memory

 SYNOPSIS



#include <stdlib.h>

void free(void *ptr);

 DESCRIPTION

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

Any use of a pointer that refers to freed space causes undefined behaviour.

 RETURN VALUE

The free() function returns no value.

 ERRORS

No errors are defined.

 EXAMPLES

None.

 APPLICATION USAGE

There is now no requirement for the implementation to support the inclusion of <malloc.h>.

 FUTURE DIRECTIONS

None.

 SEE ALSO

calloc(), malloc(), realloc(), <stdlib.h>.

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]