Function count_thread_allocations

Source
pub fn count_thread_allocations<R>(f: impl FnOnce() -> R) -> (R, usize)
Expand description

Run f while counting successful heap allocations on the current thread. Restores previous state on unwind. Requires LocalAllocCounter installed.