malloc_usable_size()
QNX SDP8.0C Library ReferenceAPIDeveloper
Obtain the size of an allocated memory block
Synopsis:
#include <malloc.h>
size_t malloc_usable_size( void *mem );
Arguments:
- mem
- A pointer to a memory block previously allocated by a memory allocation function (e.g., malloc(), calloc(), or realloc()).
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The malloc_usable_size() function returns the size of an allocated memory block.
Returns:
The usable size of the block pointed to by mem, in bytes. The returned size may be larger that the size of the allocation due to internal overhead or alignment padding used by the allocator.
If mem is NULL, the function returns 0.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |
Page updated: