1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # framealloc
//!
//! Intent-aware, thread-smart memory allocation for Rust game engines.
//!
//! ## Features
//!
//! - Frame-based arenas (bump allocation, reset per frame)
//! - Thread-local fast paths (zero locks in common case)
//! - Automatic ST → MT scaling
//! - Optional Bevy integration
//! - Allocation diagnostics & budgeting
//! - Streaming allocator for large assets
//! - Handle-based allocation with relocation support
//! - Allocation groups for bulk freeing
//! - Safe wrapper types (FrameBox, PoolBox, HeapBox)
//! - std::alloc::Allocator trait implementations
//!
//! ## v0.2.0 Features
//!
//! - **Frame phases**: Named scopes within frames for profiling
//! - **Frame checkpoints**: Save/restore points for speculative allocation
//! - **Frame collections**: FrameVec, FrameMap with fixed capacity
//! - **Tagged allocations**: First-class allocation attribution
//! - **Scratch pools**: Cross-frame reusable memory
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use framealloc::{SmartAlloc, AllocConfig};
//!
//! let alloc = SmartAlloc::new(AllocConfig::default());
//!
//! // Game loop
//! alloc.begin_frame();
//! let temp = alloc.frame_alloc::<[f32; 256]>();
//! // ... use temp ...
//! alloc.end_frame();
//! ```
// Internal modules (not directly exported)
// Feature-gated modules
// CPU module - always available
// GPU module - only available with 'gpu' feature
// Coordinator module - only available with both 'gpu' and 'coordinator' features
// Re-export all CPU functionality for backward compatibility
pub use *;