Crate framealloc

Crate framealloc 

Source
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.