| 317 | |
| 318 | template<Cache::EvictionPolicy policy> |
| 319 | void CacheShard<policy>::FreeEntry(RLHandle* e) { |
| 320 | DCHECK_EQ(e->refs.load(std::memory_order_relaxed), 0); |
| 321 | if (e->eviction_callback) { |
| 322 | e->eviction_callback->EvictedEntry(e->key(), e->value()); |
| 323 | } |
| 324 | UpdateMemTracker(-static_cast<int64_t>(e->charge)); |
| 325 | if (PREDICT_TRUE(metrics_)) { |
| 326 | metrics_->cache_usage->DecrementBy(e->charge); |
| 327 | metrics_->evictions->Increment(); |
| 328 | } |
| 329 | delete [] e; |
| 330 | } |
| 331 | |
| 332 | template<Cache::EvictionPolicy policy> |
| 333 | void CacheShard<policy>::UpdateMemTracker(int64_t delta) { |
nothing calls this directly
no test coverage detected