/// Evicts up to number entries. The implementation is pretty simple trying to evict number/N from
/// each bucket. Thus when the distribution is not optimal fewer elements will be removed.
/// Will not remove any entries when the lru eviction is disabled.
/// Returns the number of items that got evicted.
Evicts up to number entries. The implementation is pretty simple trying to evict number/N from
each bucket. Thus when the distribution is not optimal fewer elements will be removed.
Will not remove any entries when the lru eviction is disabled.
Returns the number of items that got evicted.
Evicts up to number entries . The implementation is pretty simple trying to evict number / N from each bucket . Thus when the distribution is not optimal fewer elements will be removed . Will not remove any entries when the lru eviction is disabled . Returns the number of items that got evicted .
pub fn evict(&self, number: usize) -> usize {
        if self.lru_disabled.load(Ordering::Relaxed) == 0 {
            let mut evicted = number;
            for bucket in &self.buckets {
                evicted -= bucket.evict(number / N, &mut bucket.lock_map());
            }
            evicted
        } else {
            0
        }
    }
pub fn evict ( & self , number : usize ) -> usize { if self . lru_disabled . load ( Ordering :: Relaxed ) == 0 { let mut evicted = number ; for bucket in & self . buckets { evicted -= bucket . evict ( number / N , & mut bucket . lock_map ( ) ) ; } evicted } else { 0 } }
Evicts up to number entries.
Evicts up to number entries .
&self
number
usize