Struct parity_util_mem::MallocSizeOfOps
source · [−]pub struct MallocSizeOfOps { /* private fields */ }
Expand description
Operations used when measuring heap usage of data structures.
Implementations
pub fn new(
size_of: unsafe extern "C" fn(ptr: *const c_void) -> usize,
malloc_enclosing_size_of: Option<unsafe extern "C" fn(ptr: *const c_void) -> usize>,
have_seen_ptr: Option<Box<dyn FnMut(*const c_void) -> bool>>
) -> Self
Call size_of_op
on ptr
, first checking that the allocation isn’t
empty, because some types (such as Vec
) utilize empty allocations.
Is an enclosing_size_of_op
available?
Call enclosing_size_of_op
, which must be available, on ptr
, which
must not be empty.
Call have_seen_ptr_op
on ptr
.