1 unstable release

0.1.0 Feb 16, 2024

#790 in Memory management

Download history 124/week @ 2024-07-27 43/week @ 2024-08-03 121/week @ 2024-08-10 185/week @ 2024-08-17 78/week @ 2024-08-24 8/week @ 2024-08-31 51/week @ 2024-09-07 141/week @ 2024-09-14 39/week @ 2024-09-21 16/week @ 2024-09-28 57/week @ 2024-10-05 193/week @ 2024-10-12 9/week @ 2024-10-19 256/week @ 2024-10-26 214/week @ 2024-11-02 82/week @ 2024-11-09

561 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