about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/interner/tests.rs
AgeCommit message (Collapse)AuthorFilesLines
2021-03-01 r/2259 feat(tazjin/rlox): Add a simple string internerVincent Ambo1-0/+24
This is based on this matklad post: https://matklad.github.io/2020/03/22/fast-simple-rust-interner.html It's modified slightly to provide a safer interface and slightly more readable implementation: * interned string IDs are wrapped in a newtype that is not publicly constructible * unsafe block is reduced to only the small scope in which it is needed * lookup lifetime is pinned explicitly to make the intent clearer when reading this code Change-Id: Ia3dae988f33f8e5e7d8dc0c1a9216914a945b036 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2578 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>