hashcons-arena

Crates.iohashcons-arena
lib.rshashcons-arena
version0.2.0
created_at2025-07-14 13:22:30.678844+00
updated_at2025-07-15 13:36:38.350268+00
descriptionA simple hash-consing arena
homepage
repositoryhttps://github.com/xorpse/hashcons-arena.git
max_upload_size
id1751698
size20,713
Sam L. Thomas (xorpse)

documentation

README

hashcons arena

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.

Example

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

Safety

The crate uses unsafe in a number of places, and has been tested using miri.

Commit count: 0

cargo fmt