1 unstable release

0.1.0 Feb 16, 2024

#428 in Memory management

Download history 14/week @ 2024-02-25 1/week @ 2024-03-03 7/week @ 2024-03-10 17/week @ 2024-03-31 2/week @ 2024-04-07 12/week @ 2024-04-14 10/week @ 2024-04-28 100/week @ 2024-05-05 209/week @ 2024-05-12 254/week @ 2024-05-19 101/week @ 2024-05-26 31/week @ 2024-06-02 88/week @ 2024-06-09

481 downloads per month
Used in foundation-urtypes

GPL-3.0-or-later

6KB
78 lines

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.

Examples

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}");

No runtime deps