use tracing::{trace_span, Instrument};
use tracing_subscriber::prelude::*;
use std::alloc::System;
use tracing_allocations::{ignore_allocations, trace_allocations, TracingAllocator};
#[global_allocator]
static GLOBAL: TracingAllocator<System> = TracingAllocator::new(System);
#[tokio::main]
async fn main() {
tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer())
.init();
trace_allocations(|| {
let a = Box::new([0u8; 1]);
let c = ignore_allocations(move || {
drop(a);
trace_allocations(|| {
let b = Box::new([0u8; 2]);
drop(b);
});
Box::new([0u8; 3])
});
drop(c);
});
}