Expand description
Per-frame bump arena allocation.
Provides FrameArena, a thin wrapper around bumpalo::Bump for
per-frame temporary allocations. The arena is reset at frame boundaries,
eliminating allocator churn on the hot render path.
§Usage
use ftui_render::arena::FrameArena;
let mut arena = FrameArena::new(256 * 1024); // 256 KB initial capacity
let s = arena.alloc_str("hello");
assert_eq!(s, "hello");
let slice = arena.alloc_slice(&[1u32, 2, 3]);
assert_eq!(slice, &[1, 2, 3]);
arena.reset(); // O(1) — reclaims all memory for reuse§Safety
This module uses only safe code. bumpalo::Bump provides a safe bump
allocator with automatic growth. reset() is safe and frees all
allocations, making the memory available for reuse.
Structs§
- Frame
Arena - A per-frame bump allocator for temporary render-path allocations.
Constants§
- DEFAULT_
ARENA_ CAPACITY - Default initial capacity for the frame arena (256 KB).