pub struct AllocationTracker { /* private fields */ }Expand description
Global allocation tracker for memory analysis
Implementations§
Source§impl AllocationTracker
impl AllocationTracker
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 get_stats(&self) -> AllocationStats
pub fn get_stats(&self) -> AllocationStats
Get current allocation statistics
Sourcepub fn snapshot_and_reset(&self) -> AllocationStats
pub fn snapshot_and_reset(&self) -> AllocationStats
Take snapshot of current stats and reset
Trait Implementations§
Source§impl Debug for AllocationTracker
impl Debug for AllocationTracker
Auto Trait Implementations§
impl !Freeze for AllocationTracker
impl RefUnwindSafe for AllocationTracker
impl Send for AllocationTracker
impl Sync for AllocationTracker
impl Unpin for AllocationTracker
impl UnsafeUnpin for AllocationTracker
impl UnwindSafe for AllocationTracker
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