pub struct AllocationTracker { /* private fields */ }Expand description
Tracks allocations grouped by tag.
Implementations§
Source§impl AllocationTracker
impl AllocationTracker
Sourcepub fn record_alloc(&mut self, tag: &str, bytes: u64)
pub fn record_alloc(&mut self, tag: &str, bytes: u64)
Record an allocation.
Sourcepub fn record_dealloc(&mut self, tag: &str, bytes: u64)
pub fn record_dealloc(&mut self, tag: &str, bytes: u64)
Record a deallocation.
Sourcepub fn stats_for(&self, tag: &str) -> Option<&AllocationStat>
pub fn stats_for(&self, tag: &str) -> Option<&AllocationStat>
Get stats for a tag.
Sourcepub fn total_live_bytes(&self) -> u64
pub fn total_live_bytes(&self) -> u64
Total live bytes across all tags.
Sourcepub fn total_allocated_bytes(&self) -> u64
pub fn total_allocated_bytes(&self) -> u64
Total allocated bytes across all tags.
Trait Implementations§
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