_msize
Returns the size of a memory block
#include <nwmalloc.h>
size_t _msize (
void *buffer);
The _msize function returns the size of the memory block pointed to by buffer.
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.
#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.