Expand description
Append-only interners for constants (literals and byte blobs), wrapped in an
RwLock so they can be minted through a shared & reference โ the
prerequisite for a function pass creating a constant while it holds only
a ContextView. Interned ids are globally stable and never remapped.
Reads (Index) return a &T that outlives the read guard. This is sound
because the backing Registry is address-stable: it never moves an
element once pushed (see jstd::registry::Registry), so the reference stays
valid for the life of the interner even as later mints grow it. The read lock
only guards the brief indexing.
Structsยง
- Interner
- A generic append-only interner: an address-stable
Registrybehind anRwLock. Pushes take a write lock; reads (Index) take a read lock and hand back a stable&T. - Literal
Interner - The literal interner: an address-stable literal
Registryplus its dedup cache(masked value, type) โ LiteralId, together behind oneRwLockso the check-or-mint is atomic. Reads (Index) hand back a stable&Literal.