metricus_allocator 0.0.16

Low latency metrics framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use metricus_allocator::{CountingAllocator, enable_allocator_instrumentation};

#[global_allocator]
static GLOBAL: CountingAllocator = CountingAllocator;

fn foo() -> usize {
    Vec::<u8>::with_capacity(1024).capacity()
}

fn main() {
    let task = std::thread::spawn(|| {
        enable_allocator_instrumentation();
        assert_eq!(1024, foo());
    });
    task.join().unwrap();
}