Expand description
§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
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();Re-exports§
pub use cpu::*;
Modules§
- cpu
- CPU memory management module
Macros§
- fa_
assert - Assert a condition or emit a diagnostic.
- fa_
compile_ error - Compile-time diagnostic error.
- fa_
compile_ warning - Compile-time diagnostic warning (via deprecated).
- fa_
debug - Debug-only diagnostic (completely removed in release).
- fa_
diagnostic - Emit a runtime diagnostic.
- fa_
diagnostic_ ctx - Emit a runtime diagnostic with captured context.
- fa_emit
- Emit a predefined diagnostic by code.
- fa_
emit_ ctx - Emit a predefined diagnostic with context.