pub struct AllocationTracker { /* private fields */ }Expand description
Tracks memory allocations and deallocations.
Implementations§
Source§impl AllocationTracker
impl AllocationTracker
Sourcepub fn record_alloc(&self, ptr: usize, size: usize, align: usize)
pub fn record_alloc(&self, ptr: usize, size: usize, align: usize)
Record an allocation.
Sourcepub fn record_dealloc(&self, ptr: usize, size: usize)
pub fn record_dealloc(&self, ptr: usize, size: usize)
Record a deallocation.
Sourcepub fn stats(&self) -> AllocationStats
pub fn stats(&self) -> AllocationStats
Get current statistics.
Sourcepub fn active_allocations(&self) -> Vec<AllocationRecord>
pub fn active_allocations(&self) -> Vec<AllocationRecord>
Get active allocations.
Sourcepub fn old_allocations(&self, threshold: Duration) -> Vec<AllocationRecord>
pub fn old_allocations(&self, threshold: Duration) -> Vec<AllocationRecord>
Get allocations older than a threshold (potential leaks).
Sourcepub fn histogram(&self) -> SizeHistogram
pub fn histogram(&self) -> SizeHistogram
Get allocation size histogram.
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 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