native/native.rs
1use smartalloc::{sm_dump, sm_static, SmartAlloc};
2
3#[global_allocator]
4static GLOBAL: SmartAlloc = SmartAlloc;
5
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}