pub struct Snapshot {
pub alloc_calls: u64,
pub realloc_calls: u64,
pub free_calls: u64,
pub allocated_bytes: u64,
pub freed_bytes: u64,
pub live_bytes: u64,
pub global_peak_bytes: u64,
pub failures: u64,
}Expand description
Requested-allocation ledger read from the process-wide counters.
A default value is an all-zero value, not a read of the current counters. Individual fields can reflect different instants while allocations continue.
Fields§
§alloc_calls: u64Successful alloc and alloc_zeroed calls; excludes reallocations.
realloc_calls: u64Successful reallocations, including those that retain the same address.
free_calls: u64Explicit dealloc calls; excludes the old side of a reallocation.
allocated_bytes: u64Cumulative requested bytes of successful allocations and new realloc sizes.
freed_bytes: u64Cumulative explicit deallocation sizes and old sizes of successful reallocations.
live_bytes: u64Net requested bytes still accounted as live; excludes allocator rounding.
global_peak_bytes: u64Largest net live-byte count recorded since counting began, across all threads. This is not a phase-local peak or the allocator’s transient old/new storage overlap during a reallocation.
failures: u64Allocation or reallocation calls that returned a null pointer. Such calls do not update the successful-call or byte counters.