pub struct AllocationEvent {
pub task_id: TaskId,
pub ptr: usize,
pub size: usize,
pub timestamp: u64,
pub event_type: u8,
/* private fields */
}Expand description
Memory allocation or deallocation event
Optimized for cache efficiency with 64-byte alignment to avoid false sharing. Uses minimal fields to reduce memory overhead while capturing essential data.
Fields§
§task_id: TaskIdUnique task identifier
ptr: usizeMemory pointer address
size: usizeAllocation size in bytes
timestamp: u64Timestamp (TSC ticks or nanoseconds)
event_type: u8Event type: 0=allocation, 1=deallocation
Implementations§
Source§impl AllocationEvent
impl AllocationEvent
Sourcepub fn allocation(
task_id: TaskId,
ptr: usize,
size: usize,
timestamp: u64,
) -> Self
pub fn allocation( task_id: TaskId, ptr: usize, size: usize, timestamp: u64, ) -> Self
Create new allocation event
Sourcepub fn deallocation(
task_id: TaskId,
ptr: usize,
size: usize,
timestamp: u64,
) -> Self
pub fn deallocation( task_id: TaskId, ptr: usize, size: usize, timestamp: u64, ) -> Self
Create new deallocation event
Sourcepub fn is_allocation(&self) -> bool
pub fn is_allocation(&self) -> bool
Check if this is an allocation event
Sourcepub fn is_deallocation(&self) -> bool
pub fn is_deallocation(&self) -> bool
Check if this is a deallocation event
Trait Implementations§
Source§impl Clone for AllocationEvent
impl Clone for AllocationEvent
Source§fn clone(&self) -> AllocationEvent
fn clone(&self) -> AllocationEvent
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 AllocationEvent
impl Debug for AllocationEvent
impl Copy for AllocationEvent
Auto Trait Implementations§
impl Freeze for AllocationEvent
impl RefUnwindSafe for AllocationEvent
impl Send for AllocationEvent
impl Sync for AllocationEvent
impl Unpin for AllocationEvent
impl UnwindSafe for AllocationEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more