1 unstable release

0.1.0 Feb 16, 2024

#396 in Memory management

Download history 2/week @ 2024-03-14 9/week @ 2024-03-28 10/week @ 2024-04-04 11/week @ 2024-04-11 1/week @ 2024-04-18 1/week @ 2024-04-25 70/week @ 2024-05-02 185/week @ 2024-05-09 236/week @ 2024-05-16 118/week @ 2024-05-23 75/week @ 2024-05-30 77/week @ 2024-06-06 91/week @ 2024-06-13 160/week @ 2024-06-20 51/week @ 2024-06-27

385 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