1pub mod access_tracking;
29pub mod allocation;
30pub mod drop_chain;
31pub mod dynamic_type;
32pub mod error;
33pub mod fragmentation;
34pub mod generic;
35pub mod leak_detection;
36pub mod lifecycle;
37pub mod memory_layout;
38pub mod ownership;
39pub mod runtime_state;
40pub mod scope;
41pub mod smart_pointer;
42pub mod stack;
43pub mod stats;
44pub mod temporary;
45pub mod timeline;
46pub mod tracking;
47
48pub use access_tracking::{
50 AccessPattern, AccessPatternType, AddressRange, BandwidthBottleneck,
51 BandwidthBottleneckLocation, BandwidthUtilization, CacheAccessInfo, CacheLatencyBreakdown,
52 ImplementationDifficulty, LocalityMetrics, MemoryAccessEvent, MemoryAccessPerformanceImpact,
53 MemoryAccessStatistics, MemoryAccessTrackingInfo, MemoryAccessType,
54 MemoryOptimizationRecommendation, MemoryOptimizationType, StridePattern,
55};
56pub use allocation::{
57 AllocationInfo, BorrowInfo, BottleneckType, CloneInfo, ContextPerformanceMetrics, ContextType,
58 HotPath, ImpactLevel, ImplementationDifficulty as AllocImplDifficulty,
59 OptimizationRecommendation, PerformanceBottleneck, PerformanceSnapshot, Priority,
60 RecommendationType, TypePerformanceImpact, TypeUsageInfo, UsageContext, UsageTimePoint,
61};
62pub use drop_chain::{
63 CleanupAction, CleanupActionType, DropBottleneckType, DropChainAnalysis, DropChainNode,
64 DropChainPerformanceMetrics, DropImplementationType, DropPerformanceBottleneck,
65 DropPerformanceCharacteristics,
66};
67pub use dynamic_type::{
68 DispatchOverhead, DynamicTypeInfo, PerformanceImpact, TypeErasureInfo, VTableInfo, VTableMethod,
69};
70pub use error::{TrackingError, TrackingResult};
71pub use fragmentation::{
72 BlockSizeRange, EnhancedFragmentationAnalysis, FragmentationCause, FragmentationCauseType,
73 FragmentationMetrics, FragmentationSeverity,
74};
75pub use generic::{
76 BranchPredictionImpact, CacheImpact, CodeBloatLevel, CompilationImpact, ConcreteTypeParameter,
77 ConstraintType, GenericConstraint, GenericInstantiationInfo, GenericTypeInfo, MemoryImpact,
78 MonomorphizationInfo, OptimizationDifficulty, PerformanceCharacteristics, SourceLocation,
79 TypeCategory, TypeParameter,
80};
81pub use leak_detection::{
82 EnhancedPotentialLeak, LeakEvidence, LeakEvidenceType, LeakImpact,
83 LeakPreventionRecommendation, LeakPreventionType, LeakRiskLevel, LeakType,
84 ResourceLeakAnalysis, ResourcePatternType, ResourceUsagePattern,
85};
86pub use lifecycle::{
87 BorrowState, EventPerformanceMetrics, LifecycleEfficiencyMetrics, LifecycleEvent,
88 LifecycleEventType, LifecyclePattern, LifecyclePatternType, LifecycleStageDurations,
89 MemoryLocationType, MemoryState, ObjectLifecycleInfo, ResourceWasteAssessment,
90 SimpleLifecyclePattern,
91};
92pub use memory_layout::{
93 AccessEfficiency, CapacityUtilization, ContainerAnalysis, ContainerEfficiencyMetrics,
94 ContainerType, FieldLayoutInfo, GrowthPattern, LayoutEfficiency, MemoryLayoutInfo,
95 OptimizationPotential, PaddingAnalysis, PaddingLocation, PaddingReason, ReallocationFrequency,
96 ReallocationPatterns, UtilizationEfficiency,
97};
98pub use ownership::{
99 ChildTypeInfo, CircularReferenceInfo, CircularReferenceType, ComposedTypeInfo, CompositionType,
100 OwnershipHierarchy, OwnershipNode, OwnershipTransferEvent, OwnershipTransferType,
101 OwnershipType, ParentTypeInfo, RelationshipType, TypeRelationshipInfo, WeakReferenceInfo,
102 WeakReferenceType,
103};
104pub use runtime_state::{
105 AllocatorStateInfo, CachePerformanceInfo, CpuUsageInfo, GcInfo, MemoryAccessPattern,
106 MemoryPressureInfo, MemoryPressureLevel, RuntimeStateInfo,
107};
108pub use scope::{
109 AllocationEventType, BorrowEvent, GrowthEvent, GrowthReason, MoveEvent, PotentialLeak,
110 RiskDistribution, ScopeAnalysis, ScopeEventType, ScopeHierarchy, ScopeInfo,
111 ScopeLifecycleMetrics, TypeLifecyclePattern, VariableRelationship,
112};
113pub use smart_pointer::{RefCountSnapshot, SmartPointerInfo, SmartPointerType};
114pub use stack::{ScopeType, StackAllocationInfo, StackScopeInfo};
115pub use stats::{
116 ConcurrencyAnalysis, FragmentationAnalysis as StatsFragmentationAnalysis, LibraryUsage,
117 MemoryStats, MemoryTypeInfo, SystemLibraryStats, TypeMemoryUsage,
118};
119pub use temporary::{CreationContext, ExpressionType, TemporaryObjectInfo, TemporaryUsagePattern};
120pub use timeline::{
121 AllocationEvent, AllocationHotspot, AllocationPattern, HotspotLocation, MemorySnapshot,
122 SafetyViolation, StackFrame, StackTraceData, StackTraceHotspot, TimeRange, TimelineData,
123};
124pub use tracking::{
125 CallPattern, CallPatternType, CallSequence, CallStackInfo, ConcurrencyCharacteristics,
126 DeadlockRisk, FunctionCallTrackingInfo, FunctionMemoryCharacteristics,
127 FunctionPerformanceCharacteristics, IOCharacteristics, LeakPotential, MemoryUsagePattern,
128 RecursionPerformanceImpact, RecursiveCallInfo, StackOverflowRisk, ThreadSafetyLevel,
129};
130
131#[cfg(test)]
132mod tests {
133 use super::*;
134
135 #[test]
136 fn test_error_reexports() {
137 let error = TrackingError::TrackingDisabled;
138 assert!(matches!(error, TrackingError::TrackingDisabled));
139 }
140
141 #[test]
142 fn test_allocation_info_creation() {
143 let info = AllocationInfo::new(0x1000, 1024);
144 assert_eq!(info.ptr, 0x1000);
145 assert_eq!(info.size, 1024);
146 }
147
148 #[test]
149 fn test_smart_pointer_info_creation() {
150 let info = SmartPointerInfo::new_rc_arc(0x1000, SmartPointerType::Rc, 1, 0);
151 assert_eq!(info.data_ptr, 0x1000);
152 assert!(info.is_data_owner);
153 }
154
155 #[test]
156 fn test_memory_stats_creation() {
157 let stats = MemoryStats::new();
158 assert_eq!(stats.total_allocations, 0);
159 }
160}