sm_dump

Function sm_dump 

Source
pub fn sm_dump(enable: bool)
Expand description

Prints orphaned buffers when enabled true with the number of allocated bytes and the line location in source code

Examples found in repository?
examples/orphan.rs (line 13)
8fn main() {
9    unsafe {
10        let alloc = SmartAlloc;
11        let layout = Layout::from_size_align(8, 8).unwrap();
12        alloc.alloc(layout);
13        sm_dump(true);
14    }
15}
More examples
Hide additional examples
examples/native.rs (line 15)
6fn main() {
7    sm_static(true); // disable from here
8    let size = 50 * 1024 * 1024;
9    let mut x: Vec<usize> = Vec::new();
10    for i in 0..size {
11        x.push(i);
12    }
13    println!("{:?}", x.iter().sum::<usize>());
14    sm_static(false); // enable from here
15    sm_dump(true); // doesn't track anything after is enabled
16}