pub struct AllocatorStats {
pub total_allocations: AtomicU64,
pub total_deallocations: AtomicU64,
pub bytes_allocated: AtomicUsize,
pub peak_bytes_allocated: AtomicUsize,
pub allocation_failures: AtomicU64,
pub slab_hits: AtomicU64,
pub slab_misses: AtomicU64,
}Expand description
Statistics for allocator performance tracking
Fields§
§total_allocations: AtomicU64Total number of allocations
total_deallocations: AtomicU64Total number of deallocations
bytes_allocated: AtomicUsizeCurrent bytes allocated
peak_bytes_allocated: AtomicUsizePeak bytes allocated
allocation_failures: AtomicU64Number of allocation failures
slab_hits: AtomicU64Number of slab hits
slab_misses: AtomicU64Number of slab misses
Implementations§
Source§impl AllocatorStats
impl AllocatorStats
Sourcepub fn record_allocation(&self, size: usize)
pub fn record_allocation(&self, size: usize)
Record an allocation
Sourcepub fn record_deallocation(&self, size: usize)
pub fn record_deallocation(&self, size: usize)
Record a deallocation
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record an allocation failure
Sourcepub fn record_slab_hit(&self)
pub fn record_slab_hit(&self)
Record a slab hit
Sourcepub fn record_slab_miss(&self)
pub fn record_slab_miss(&self)
Record a slab miss
Sourcepub fn current_allocations(&self) -> u64
pub fn current_allocations(&self) -> u64
Get current allocation count
Sourcepub fn slab_hit_rate(&self) -> f64
pub fn slab_hit_rate(&self) -> f64
Get slab hit rate
Trait Implementations§
Source§impl Debug for AllocatorStats
impl Debug for AllocatorStats
Source§impl Default for AllocatorStats
impl Default for AllocatorStats
Source§fn default() -> AllocatorStats
fn default() -> AllocatorStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AllocatorStats
impl RefUnwindSafe for AllocatorStats
impl Send for AllocatorStats
impl Sync for AllocatorStats
impl Unpin for AllocatorStats
impl UnsafeUnpin for AllocatorStats
impl UnwindSafe for AllocatorStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more