Module core

Module core 

Source
Expand description

Core memory tracking functionality Core memory tracking functionality

This module contains the fundamental components for memory tracking:

  • Memory tracker implementation
  • Custom allocator
  • Type definitions
  • Scope tracking

Re-exports§

pub use allocator::TrackingAllocator;
pub use tracker::get_tracker;
pub use tracker::MemoryTracker;
pub use types::AllocationInfo;
pub use types::TrackingError;
pub use types::TrackingResult;
pub use error::DefaultErrorRecovery;
pub use error::ErrorRecovery;
pub use error::ErrorSeverity;
pub use error::MemScopeError;
pub use error::MemoryOperation;
pub use error::RecoveryAction;
pub use error::Result as MemScopeResult;
pub use error::SystemErrorType;
pub use error_adapter::adapt_result;
pub use error_adapter::from_tracking_error;
pub use error_adapter::to_tracking_error;
pub use error_adapter::to_tracking_result;
pub use error_adapter::DefaultErrorAdapter;
pub use error_adapter::ErrorAdapter;
pub use unwrap_safe::get_unwrap_stats;
pub use unwrap_safe::update_unwrap_stats;
pub use unwrap_safe::UnwrapSafe;
pub use unwrap_safe::UnwrapStats;
pub use string_pool::get_string_pool_stats;
pub use string_pool::intern_string;
pub use string_pool::StringPoolStats;
pub use string_pool_monitor::get_string_pool_monitor_stats;
pub use string_pool_monitor::MemoryEfficiencyMetrics;
pub use string_pool_monitor::OptimizationRecommendation;
pub use string_pool_monitor::PerformanceMetrics;
pub use string_pool_monitor::StringPoolMonitorStats;
pub use string_pool_monitor::UsagePatterns;
pub use optimized_types::OptimizedAllocationInfo;
pub use atomic_stats::AtomicMemoryStats;
pub use atomic_stats::AtomicPerformanceCounters;
pub use atomic_stats::MemoryStatsSnapshot;
pub use atomic_stats::PerformanceSnapshot;
pub use atomic_stats::SimpleMemoryStats;
pub use optimized_locks::LockFreeCounter;
pub use optimized_locks::OptimizedMutex;
pub use optimized_locks::OptimizedRwLock;
pub use sharded_locks::ShardStats;
pub use sharded_locks::ShardedMutex;
pub use sharded_locks::ShardedRwLock;
pub use adaptive_hashmap::AdaptiveHashMap;
pub use simple_mutex::SimpleMutex;
pub use smart_optimization::SmartClone;
pub use smart_optimization::SmartMutex;
pub use smart_optimization::SmartStats;
pub use targeted_optimizations::efficient_string_concat;
pub use targeted_optimizations::BatchProcessor;
pub use targeted_optimizations::FastStatsCollector;
pub use threshold_batch_processor::BatchConfig;
pub use threshold_batch_processor::ProcessingStats;
pub use threshold_batch_processor::ThresholdBatchProcessor;
pub use allocation_adapter::AllocationCollection;
pub use allocation_adapter::AllocationInfoAdapter;
pub use allocation_adapter::CollectionMemoryStats;
pub use clone_monitor::get_clone_stats;
pub use clone_monitor::get_optimization_recommendations;
pub use clone_monitor::CloneMonitorStats;
pub use clone_optimizer::CloneInfo;
pub use clone_optimizer::CloneOptimizer;
pub use clone_optimizer::CloneStats;
pub use clone_utils::clone_shared_allocation;
pub use clone_utils::optimized_clone;
pub use clone_utils::share_allocation_info;
pub use optimized_tracker::OptimizedMemoryTracker;
pub use shared_types::SharedAllocationCollection;
pub use shared_types::SharedAllocationInfo;
pub use shared_types::SharedConfig;
pub use bounded_memory_stats::AllocationHistoryManager;
pub use bounded_memory_stats::AllocationSummary;
pub use bounded_memory_stats::BoundedMemoryStats;
pub use bounded_memory_stats::BoundedStatsConfig;
pub use bounded_memory_stats::HistoricalSummary;
pub use bounded_memory_stats::MemoryUsageStats;
pub use enhanced_pointer_extractor::EnhancedPointerExtractor;
pub use enhanced_pointer_extractor::EnhancedTrackable;
pub use enhanced_pointer_extractor::PointerInfo;
pub use enhanced_pointer_extractor::PointerStatistics;
pub use enhanced_pointer_extractor::SyntheticReason;
pub use enhanced_pointer_extractor::TypeCategory;
pub use enhanced_pointer_extractor::TypeInfo;
pub use enhanced_type_inference::AllocationContext;
pub use enhanced_type_inference::InferenceMethod;
pub use enhanced_type_inference::InferenceStatistics;
pub use enhanced_type_inference::InferredType;
pub use enhanced_type_inference::TypeConfidence;
pub use enhanced_type_inference::TypeInferenceEngine;
pub use enhanced_type_inference::TypeSignature;
pub use tracker::configure_tracking_strategy;
pub use crate::unified::detect_environment;
pub use crate::unified::detect_environment_detailed;
pub use crate::unified::quick_start as unified_quick_start;
pub use crate::unified::test_unified_system;
pub use crate::unified::AsyncRuntimeType;
pub use crate::unified::BackendConfig;
pub use crate::unified::BackendError;
pub use crate::unified::DetectionConfig;
pub use crate::unified::DetectionMetadata;
pub use crate::unified::DetectionMethod;
pub use crate::unified::DispatcherConfig;
pub use crate::unified::DispatcherMetrics;
pub use crate::unified::EnvironmentAnalysis;
pub use crate::unified::EnvironmentDetector;
pub use crate::unified::MemoryAnalysisData;
pub use crate::unified::MemoryStatistics;
pub use crate::unified::MemoryTracker as UnifiedMemoryTracker;
pub use crate::unified::RuntimeEnvironment;
pub use crate::unified::SessionMetadata;
pub use crate::unified::TrackerConfig;
pub use crate::unified::TrackerError;
pub use crate::unified::TrackerStatistics;
pub use crate::unified::TrackerType;
pub use crate::unified::TrackingDispatcher;
pub use crate::unified::TrackingOperation;
pub use crate::unified::TrackingSession;
pub use crate::unified::TrackingStrategy;
pub use crate::unified::UnifiedBackend;
pub use ownership_history::ActiveBorrow;
pub use ownership_history::BorrowInfo;
pub use ownership_history::BorrowType;
pub use ownership_history::CloneInfo as OwnershipCloneInfo;
pub use ownership_history::HistoryConfig;
pub use ownership_history::OwnershipEvent;
pub use ownership_history::OwnershipEventDetails;
pub use ownership_history::OwnershipEventType;
pub use ownership_history::OwnershipHistoryExport;
pub use ownership_history::OwnershipHistoryRecorder;
pub use ownership_history::OwnershipStatistics;
pub use ownership_history::OwnershipSummary;
pub use ownership_history::RefCountInfo;
pub use lifecycle_summary::AllocationLifecycleSummary;
pub use lifecycle_summary::ExportMetadata;
pub use lifecycle_summary::LifecycleEvent;
pub use lifecycle_summary::LifecycleEventSummary;
pub use lifecycle_summary::LifecycleExportData;
pub use lifecycle_summary::LifecyclePattern;
pub use lifecycle_summary::LifecycleSummaryGenerator;
pub use lifecycle_summary::SummaryConfig;
pub use lifecycle_summary::VariableGroup;
pub use call_stack_normalizer::get_global_call_stack_normalizer;
pub use call_stack_normalizer::initialize_global_call_stack_normalizer;
pub use call_stack_normalizer::CallStackId;
pub use call_stack_normalizer::CallStackNormalizer;
pub use call_stack_normalizer::CallStackRef;
pub use call_stack_normalizer::NormalizedCallStack;
pub use call_stack_normalizer::NormalizerConfig;
pub use call_stack_normalizer::NormalizerStats;

Modules§

adaptive_hashmap
Adaptive HashMap that switches between simple and sharded modes based on contention
allocation_adapter
Compatibility adapter for AllocationInfo migration
allocator
Custom global allocator for tracking memory allocations.
atomic_stats
Atomic statistics system for lock-free performance monitoring
bounded_memory_stats
Bounded memory statistics to prevent infinite growth
call_stack_normalizer
Call Stack Normalization System
clone_monitor
Clone operation monitoring and optimization tracking
clone_optimizer
Clone optimization system for reducing unnecessary clone() calls
clone_utils
Utilities for optimizing clone operations
comprehensive_data_deduplicator
Comprehensive Data Deduplication System
edge_case_handler
Edge Case Handler - Comprehensive edge case and error handling
enhanced_call_stack_normalizer
Enhanced Call Stack Normalization System
enhanced_pointer_extractor
Enhanced pointer extraction with real pointer prioritization
enhanced_type_inference
Enhanced type inference engine
error
Unified error handling system for memscope-rs
error_adapter
Error adapter for backward compatibility
fast_data_deduplicator
Simple Data Deduplicator - High Performance Version
integration_validator
Integration Validator - Validates all enhanced components work together
lifecycle_summary
Lifecycle summary generation for enhanced memory analysis
optimized_locks
Optimized lock implementations using parking_lot
optimized_tracker
Optimized memory tracker using Arc sharing to reduce clone overhead
optimized_types
Optimized data structures using string interning and Arc sharing
ownership_history
Ownership history tracking system
safe_operations
Safe Operations - Provides safe lock operations
scope_tracker
Scope tracking functionality for memory analysis
sharded_locks
Sharded lock system for reducing lock contention
shared_types
Arc-shared data structures for reducing clone overhead
simple_mutex
Simple mutex implementation with compile-time optimization selection
smart_optimization
Smart optimization based on actual performance analysis
string_pool
Global string pool system for memory optimization
string_pool_monitor
String pool monitoring and statistics
targeted_optimizations
Targeted optimizations for actual performance bottlenecks
test_optimized_locks
Tests for optimized lock implementations
thread_registry
Thread registry for managing thread-local memory trackers and data aggregation.
threshold_batch_processor
Threshold-based batch processor that adapts based on operation frequency
tracker
Memory tracking module with modular structure.
types
Type definitions
unwrap_safe
Safe unwrap utilities for memscope-rs