Removes all instances of the specified key from the eviction index.
(&self, key: u64)
| 87 | |
| 88 | /// Removes all instances of the specified key from the eviction index. |
| 89 | pub fn remove_key(&self, key: u64) { |
| 90 | for i in 0..self.inner.len() { |
| 91 | let slot = &self.inner[i]; |
| 92 | let current = slot.load(Ordering::Acquire); |
| 93 | if current == key { |
| 94 | // Attempt to clear the slot if it still contains the key |
| 95 | let _ = |
| 96 | slot.compare_exchange(current, u64::MAX, Ordering::SeqCst, Ordering::Relaxed); |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | pub struct ProbEviction { |