dlmalloc_usable_size

Function dlmalloc_usable_size 

Source
pub unsafe extern "C" fn dlmalloc_usable_size(p: *mut c_void) -> usize
Expand description

malloc_usable_size(void* p);

Returns the number of bytes you can actually use in an allocated chunk, which may be more than you requested (although often not) due to alignment and minimum size constraints. You can use this many bytes without worrying about overwriting other allocated objects. This is not a particularly great programming practice. malloc_usable_size can be more useful in debugging and assertions, for example:

p = malloc(n);
assert(malloc_usable_size(p) >= 256);