pub unsafe extern "C" fn malloc_stats_print(
write_cb: extern "C" fn(*mut c_void, *const i8),
cbopaque: *mut c_void,
opts: *const i8
Writes summary statistics via the
write_cb callback function pointer
cbopaque data passed to
The statistics are presented in human-readable form unless “J” is specified as a character within the opts string, in which case the statistics are presented in JSON format.
This function can be called repeatedly.
General information that never changes during execution can be omitted
g as a character within the opts string.
malloc_message uses the
mallctl* functions internally,
so inconsistent statistics can be reported if multiple threads use these
If the Cargo feature
stats is enabled,
a can be
specified to omit merged arena, destroyed merged arena, and per arena
l can be specified to omit per size
class statistics for bins and large objects, respectively;
x can be
specified to omit all mutex statistics. Unrecognized characters are
Note that thread caching may prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations.