Expand description
String interning for attribute names and identifiers. Re-export the shared interner crate.
Modules§
- memo
ContentMemo+ thethread_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
ContentMemoplus a memoized accessor and a clear fn — the boilerplate that was hand-rolled at every memo site. Real-easy front: one declaration replaces thethread_local!+get_or_computewrapper +clearwrapper trio.
Structs§
- Interner
- A string interner that maps strings to
Symbolhandles. - 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
Symbolindices 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.