[][src]Function alloc_counter::count_alloc_future

Important traits for AsyncGuard<F>
pub fn count_alloc_future<F>(future: F) -> AsyncGuard<F>

Count the allocations, reallocations, and deallocations that happen duringexecution of a future.

Example:

let (counts, result) = block_on(count_alloc_future(async { Box::new(0); }));
assert_eq!(counts, (1, 0, 1));