Why arena-lib
Allocator-aware Rust normally means juggling three or four crates: one for slab storage, one for handle stability, one for string interning, plus a bump arena for short-lived scratch. arena-lib collects those primitives behind a single, safe, REPS-disciplined surface so you can move fast without paying for it later.
Designed around four guarantees:
- Typed arenas — one backing allocation per element type, predictable layout, cache-friendly traversal.
- Generational indices — stable handles that catch use-after-free without reference counting.
- String interning — O(1) equality and compact storage for repeated identifiers.
- Bump allocation — short-lived scratch regions that reset in constant time.
Every public path is safe Rust. unsafe lives only in measured, documented internals — never in your call sites.
Status: v0.2.0 (Foundation). The four core primitives — generational arena, string interner, bump arena, and the shared
Errortype — are live and tested. The 1.0 contract is in place; the 0.5 milestone tunes hot paths and grows the bump arena to multi-chunk.
Quick start
Add the crate to your Cargo.toml:
[]
= "0.2"
End-to-end use of every primitive:
use *;
See docs/API.md for the full reference, including the planned 1.0 surface.
Standards
- REPS governs every decision. See REPS.md.
- MSRV: Rust 1.85.
- Edition: 2024.
- Cross-platform: Linux, macOS, Windows.
License
Dual-licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.