pub struct SingleThreadStrategy { /* private fields */ }
Expand description
Single-threaded memory tracking strategy Optimized for applications with single execution thread Uses direct global storage for maximum performance
Implementations§
Source§impl SingleThreadStrategy
impl SingleThreadStrategy
Sourcepub fn new() -> Self
pub fn new() -> Self
Create new single-thread strategy instance Returns uninitialized strategy ready for configuration
Sourcepub fn with_aggregator(output_dir: PathBuf) -> Self
pub fn with_aggregator(output_dir: PathBuf) -> Self
Create strategy with integration to existing aggregator Enables compatibility with existing lockfree infrastructure
Sourcepub fn with_core_integration() -> Self
pub fn with_core_integration() -> Self
Create strategy with full core tracker integration Enables seamless integration with existing global tracking system
Sourcepub fn with_full_integration(output_dir: PathBuf) -> Self
pub fn with_full_integration(output_dir: PathBuf) -> Self
Create strategy with both aggregator and core integration Provides maximum compatibility with existing infrastructure
Sourcepub fn track_allocation(
&mut self,
ptr: usize,
size: usize,
var_name: Option<String>,
type_name: String,
) -> Result<(), TrackerError>
pub fn track_allocation( &mut self, ptr: usize, size: usize, var_name: Option<String>, type_name: String, ) -> Result<(), TrackerError>
Track new memory allocation Records allocation details with minimal overhead
Sourcepub fn track_deallocation(&mut self, ptr: usize) -> Result<(), TrackerError>
pub fn track_deallocation(&mut self, ptr: usize) -> Result<(), TrackerError>
Track memory deallocation Updates existing allocation record with deallocation timestamp
Trait Implementations§
Source§impl Default for SingleThreadStrategy
impl Default for SingleThreadStrategy
Source§impl MemoryTracker for SingleThreadStrategy
impl MemoryTracker for SingleThreadStrategy
Source§fn initialize(&mut self, config: TrackerConfig) -> Result<(), TrackerError>
fn initialize(&mut self, config: TrackerConfig) -> Result<(), TrackerError>
Initialize strategy with provided configuration Sets up tracking infrastructure and validates configuration
Source§fn start_tracking(&mut self) -> Result<(), TrackerError>
fn start_tracking(&mut self) -> Result<(), TrackerError>
Start active memory tracking Transitions strategy to active state and begins collecting data
Source§fn stop_tracking(&mut self) -> Result<Vec<u8>, TrackerError>
fn stop_tracking(&mut self) -> Result<Vec<u8>, TrackerError>
Stop tracking and collect all data Returns serialized tracking data in compatible format
Source§fn get_statistics(&self) -> TrackerStatistics
fn get_statistics(&self) -> TrackerStatistics
Get current tracking statistics Provides real-time performance and usage metrics
Source§fn tracker_type(&self) -> TrackerType
fn tracker_type(&self) -> TrackerType
Get strategy type identifier
Auto Trait Implementations§
impl !Freeze for SingleThreadStrategy
impl RefUnwindSafe for SingleThreadStrategy
impl Send for SingleThreadStrategy
impl Sync for SingleThreadStrategy
impl Unpin for SingleThreadStrategy
impl UnwindSafe for SingleThreadStrategy
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
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>
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>
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