Crate foundation_arena

source ·
Expand description

§Foundation Arena.

This crate provides an alternative to the [typed_arena] crate that does not use the heap. Instead, the Arena type statically allocates memory at compile-time by passing the N type parameter.


use foundation_arena::Arena;

let arena: Arena<u32, 8> = Arena::new();
let one: &mut u32 = arena.alloc(1).unwrap();
let two: &mut u32 = arena.alloc(2).unwrap();

println!("{one} {two}");



  • An arena of objects of type T.