use tracing_allocator::{TracingAllocator, default_tracing_allocator, trace_allocs};
#[global_allocator]
static ALLOCATOR: TracingAllocator = default_tracing_allocator();
fn main() {
let (_, stats) = trace_allocs(|| {
let r: Vec<u8> = vec![1, 2, 3];
r
});
assert_eq!(stats.peak, 3);
assert_eq!(stats.current, 3);
}
forked from openmina/alloc-test
-
Notifications
You must be signed in to change notification settings - Fork 0
lambdaclass/alloc-test
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
Memory allocations testing
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Rust 100.0%