pub struct AdmissionFilter {
pub ghost_mask: usize,
pub ghost_set: Arc<[AtomicU16]>,
}Expand description
Ghost Set — direct-mapped fingerprint array.
Records the 16-bit fingerprint of evicted items so that previously-hot items bypass TLS probation on re-insertion.
§Task 5 — Capacity Align
Ghost Set size is always equal to the Arena’s capacity (already a power
of two). When the user sets a small capacity (e.g. 2000 items rounded to
2048), the Ghost Set is also 2048 × 2 bytes = 4 KB — not the previous
bloated capacity.next_power_of_two() of a larger default.
Fields§
§ghost_mask: usize§ghost_set: Arc<[AtomicU16]>Implementations§
Source§impl AdmissionFilter
impl AdmissionFilter
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
capacity must be a power of two (enforced by Config).
Ghost Set is exactly capacity entries (2 bytes each).
Sourcepub fn record_death(&self, hash: u64)
pub fn record_death(&self, hash: u64)
Called by Daemon on eviction: record this item’s 16-bit fingerprint.
Sourcepub fn check_ghost(&self, hash: u64) -> bool
pub fn check_ghost(&self, hash: u64) -> bool
Called by Worker on insert: true if the fingerprint matches a
previously evicted item → bypass TLS probation.
pub fn clear(&self)
Auto Trait Implementations§
impl Freeze for AdmissionFilter
impl RefUnwindSafe for AdmissionFilter
impl Send for AdmissionFilter
impl Sync for AdmissionFilter
impl Unpin for AdmissionFilter
impl UnsafeUnpin for AdmissionFilter
impl UnwindSafe for AdmissionFilter
Blanket Implementations§
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