pub struct AllocationInfo {
pub ptr: usize,
pub size: usize,
pub timestamp_alloc: u128,
pub timestamp_dealloc: Option<u128>,
pub var_name: Option<String>,
pub type_name: Option<String>,
pub thread_id: String,
}
Expand description
Information about a memory allocation
Fields§
§ptr: usize
Memory address of the allocation
size: usize
Size of the allocation in bytes
timestamp_alloc: u128
Timestamp when the allocation occurred (milliseconds since UNIX_EPOCH)
timestamp_dealloc: Option<u128>
Timestamp when the deallocation occurred (if applicable)
var_name: Option<String>
Optional name of the variable associated with this allocation
type_name: Option<String>
Optional type name of the variable associated with this allocation
thread_id: String
Thread ID where the allocation occurred
Implementations§
Source§impl AllocationInfo
impl AllocationInfo
Sourcepub fn mark_deallocated(&mut self)
pub fn mark_deallocated(&mut self)
Mark this allocation as deallocated
Sourcepub fn lifetime_ms(&self) -> Option<u128>
pub fn lifetime_ms(&self) -> Option<u128>
Get the lifetime of this allocation in milliseconds
Trait Implementations§
Source§impl Clone for AllocationInfo
impl Clone for AllocationInfo
Source§fn clone(&self) -> AllocationInfo
fn clone(&self) -> AllocationInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AllocationInfo
impl Debug for AllocationInfo
Source§impl<'de> Deserialize<'de> for AllocationInfo
impl<'de> Deserialize<'de> for AllocationInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AllocationInfo
impl RefUnwindSafe for AllocationInfo
impl Send for AllocationInfo
impl Sync for AllocationInfo
impl Unpin for AllocationInfo
impl UnwindSafe for AllocationInfo
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