_msize

Returns the size of a memory block

Local Servers:blocking
Remote Servers:N/A
Classification:Other
Service:Memory Allocation

Syntax

  #include <nwmalloc.h> 
    
  size_t _msize  (  
     void   *buffer);
  

Return Values

The _msize function returns the size of the memory block pointed to by buffer.

Remarks

The _msize function returns the size of the memory block pointed to by buffer that was allocated by a call to calloc, malloc, or realloc.

See Also

calloc, malloc, realloc

Example

  #include <nwmalloc.h>  
   
  main ()  
  {  
     void *buffer;  
     buffer = malloc ( 999 );  
     printf ("Size of block is %u bytes\n", _msize (buffer) );  
  }
  

produces the following:

  Size of block is 1000 bytes
  

The size of the memory is larger than the requested size due to space required for alignment.