hashcons-arena 0.1.0

A simple hash-consing arena
Documentation

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.