clib_memory_block_length
length.i4.v = clib_memory_block_length(address.i1p.v)
This routine returns the length of a block of dynamic memory
allocated by a previous call to either clib_malloc, clib_calloc,
or clib_realloc. If an invalid pointer is passed or memory
diagnostics are not on, a value of zero will be returned.
address address of previously allocated memory
This function returns status values as follows:
0 invalid pointer or memory diagnostics are off
otherwise length of the allocated block in bytes
This function requires the following include files:
clib_memory_h
Related functions:
clib_malloc, clib_calloc, clib_realloc, clib_free,
memory_diagnostic_control_c, clib_memory_info, memory_analyze
C/C++ usage:
char *address;
int length;
length = clib_memory_block_length(address);