pub struct DualCacheCore<K, V, P: CachePolicy = DefaultExponentialPolicy, const T0_CAP: usize = 64, const T1_CAP: usize = 4096, const T2_CAP: usize = 262144, const TOTAL_CAP: usize = { 64 + 4096 + 262144 }> {
pub arena: Arena<K, V, TOTAL_CAP>,
pub t0: FastTier<T0_CAP>,
pub t1: FastTier<T1_CAP>,
pub t2: CacheTier<K, V, P::Evict, T2_CAP, 8>,
pub blackjack: PackedBlackjack,
/* private fields */
}Expand description
The independent orchestrator that glues T0, T1, and T2 together.
Designed for no_std environments.
Fields§
§arena: Arena<K, V, TOTAL_CAP>§t0: FastTier<T0_CAP>§t1: FastTier<T1_CAP>§t2: CacheTier<K, V, P::Evict, T2_CAP, 8>§blackjack: PackedBlackjackImplementations§
Source§impl<K, V, P: CachePolicy, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P: CachePolicy, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
pub const fn new(eviction: P::Evict) -> Self
pub fn hash_key(&self, key: &K) -> usize
pub fn get_t0<'g>( &self, hash: usize, key: &K, _guard: &'g Guard, _op_count: u32, ) -> Option<&'g V>
pub fn get_t1<'g>( &self, hash: usize, key: &K, _guard: &'g Guard, _op_count: u32, ) -> Option<&'g V>
pub fn get_t2<'g>( &'g self, hash: usize, key: &K, guard: &'g Guard, op_count: u32, ) -> Option<(&'g V, u8, Option<(K, V)>)>
pub fn get<'g>( &'g self, key: &K, guard: &'g Guard, op_count: u32, ) -> Option<(&'g V, u8, Option<(K, V)>)>
pub fn put_t0(&self, key: K, value: V, node: *mut ThreadStateNode)
pub fn put_t1(&self, key: K, value: V, node: *mut ThreadStateNode)
pub fn put(&self, key: K, value: V, node: *mut ThreadStateNode)
pub fn try_reclaim(&self, _node: *mut ThreadStateNode)
Sourcepub fn sync_reclaim(&self)
pub fn sync_reclaim(&self)
Synchronous inline reclamation for Lock-based caches (e.g., StaticDualCache) that do not have a background daemon thread. MUST ONLY be called when protected by a Mutex to avoid data races on the single-consumer QSBR garbage queues.
Sourcepub fn record_remote_hit(&self, hash: usize, _weight: u8)
pub fn record_remote_hit(&self, hash: usize, _weight: u8)
Record a remote hit for an item based on its hash. Used by the Daemon to propagate TLS hits into the global T2 cache.
pub fn set_prefetch_hint(&self, hash: usize, next_hash: usize)
Trait Implementations§
Source§impl<K, V, P: CachePolicy, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> Default for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P: CachePolicy, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> Default for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
Auto Trait Implementations§
impl<K, V, P = DefaultExponentialPolicy, const T0_CAP: usize = 64, const T1_CAP: usize = 4096, const T2_CAP: usize = 262144, const TOTAL_CAP: usize = { 64 + 4096 + 262144 }> !Freeze for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P = DefaultExponentialPolicy, const T0_CAP: usize = 64, const T1_CAP: usize = 4096, const T2_CAP: usize = 262144, const TOTAL_CAP: usize = { 64 + 4096 + 262144 }> !RefUnwindSafe for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> Send for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> Sync for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> Unpin for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> UnsafeUnpin for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
impl<K, V, P, const T0_CAP: usize, const T1_CAP: usize, const T2_CAP: usize, const TOTAL_CAP: usize> UnwindSafe for DualCacheCore<K, V, P, T0_CAP, T1_CAP, T2_CAP, TOTAL_CAP>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more