[][src]Attribute Macro alloc_counter::count_alloc

#[count_alloc]

Macro for counting allocations inside a functions.

After calling the function the message:

"Function #fn allocated {}, reallocated {}, deallocated {}"

is printed to stderr.

This example is not tested
// Panic only when running debug builds
#[cfg_attr(debug_assertions, count_alloc)]
fn my_function() {

}