free

Frees a previously allocated memory block

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Memory Allocation

Syntax

  #include <stdlib.h> 
  #include <nwmalloc.h> 
    
  void  free  (  
     void   *ptr);
  

Parameters

ptr
(IN) Points to a memory block previously allocated by a call to calloc, malloc, or realloc.

Return Values

The free function returns no value.

Remarks

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

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

See Also

calloc, malloc, NWGarbageCollect (NDK: NLM Development Concepts, Tools, and Functions), realloc

Example

  #include <nwmalloc.h> 
  #include <stdlib.h> 
    
  main ()  
  {  
     char   *ptr;  
     free (ptr);  
  }