| Crates.io | hashcons-arena |
| lib.rs | hashcons-arena |
| version | 0.2.0 |
| created_at | 2025-07-14 13:22:30.678844+00 |
| updated_at | 2025-07-15 13:36:38.350268+00 |
| description | A simple hash-consing arena |
| homepage | |
| repository | https://github.com/xorpse/hashcons-arena.git |
| max_upload_size | |
| id | 1751698 |
| size | 20,713 |
A hash consing arena for efficient interning of values.
This arena allows you to intern values such that structurally equal values will yield the same reference, thus saving memory and improving performance in scenarios where many identical values are used.
use hashcons_arena::HashConsArena;
let arena = HashConsArena::new();
let a = arena.intern("hello");
let b = arena.intern("hello");
assert!(a == b); // a and b are the same reference
The crate uses unsafe in a number of places, and has been tested using miri.