Skip to main content

AdmissionFilter

Struct AdmissionFilter 

Source
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

Source

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).

Source

pub fn record_death(&self, hash: u64)

Called by Daemon on eviction: record this item’s 16-bit fingerprint.

Source

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.

Source

pub fn clear(&self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.