xfree

Frees a previously allocated memory block.

Library:LibC
Classification:Other
Service:Memory Management

Syntax

  #include <xmalloc.h> 
   
  void xfree (
     void   *ptr);
  

Parameters

ptr

(IN) Points to a memory block previously allocated by a call to xcalloc, xmalloc, or xrealloc.

Remarks

When the value of ptr is NULL, the xfree function does nothing; otherwise, the xfree function deallocates the memory block located by the ptr parameter.

After a call to xfree, the freed memory block is available for allocation.

See Also