Skip to main content

Module intern

Module intern 

Source
Expand description

String interning for attribute names and identifiers. Re-export the shared interner crate.

Modules§

memo
ContentMemo + the thread_local_content_memo! macro — a byte-neutral, content-keyed memo of a pure function (the extracted shape hand-rolled at the NAR-hash / referenced-idents / overlay-flatten memo sites). ContentMemo — a byte-neutral, content-keyed memo of a PURE function.

Macros§

thread_local_content_memo
Declare a thread-local ContentMemo plus a memoized accessor and a clear fn — the boilerplate that was hand-rolled at every memo site. Real-easy front: one declaration replaces the thread_local! + get_or_compute wrapper + clear wrapper trio.

Structs§

Interner
A string interner that maps strings to Symbol handles.
Symbol
An interned string handle — a cheap, copyable, comparable token.

Functions§

intern
Intern a string using the thread-local interner.
lookup
Look up a symbol for a string in the thread-local interner without interning it.
prewarm
Intern the hot nixpkgs/flake/stdenv symbol set so they get low Symbol indices and the thread-local hashmap pays its first few resizes upfront instead of on the eval hot path.
resolve
Resolve a symbol using the thread-local interner.
resolve_rc
Resolve a symbol to a shared Rc<str> handle. Zero-copy.
with_resolved
Borrow the resolved string inside a closure without allocating. The thread-local interner stays locked for the duration of f.