Expand description
VecCache maintains a mapping from K -> (V, I) pairing. K and I must be roughly u32-sized, and V must be Copy.
VecCache supports efficient concurrent put/get across the key space, with write-once semantics (i.e., a given key can only be put once). Subsequent puts will panic.
This is currently used for query caching.
Re-exportsยง
use std::fmt;๐use std::fmt::Debug;๐use std::fmt::Debug;๐use std::marker::PhantomData;๐use std::ops::Index;๐use std::ops::IndexMut;๐use std::sync::atomic::AtomicPtr;๐use std::sync::atomic::AtomicU32;๐use std::sync::atomic::AtomicUsize;๐use std::sync::atomic::Ordering;๐use rustc_index::Idx;๐
Structsยง
- Slot ๐
- Slot
Index ๐ - This uniquely identifies a single
Slot<V>entry in the buckets map, and provides accessors for either getting the value or putting a value. - VecCache
- In-memory cache for queries whose keys are densely-numbered IDs
(e.g
CrateNum,LocalDefId), and can therefore be used as indices into a dense vector of cached values.
Enumsยง
- Bucket
Index ๐ - Index into an array of buckets.
Constantsยง
- BUCKETS ๐
- ENTRIES_
BY_ ๐BUCKET