| 321 | } |
| 322 | |
| 323 | void LRUCache::Prune() { |
| 324 | MutexLock l(&mutex_); |
| 325 | while (lru_.next != &lru_) { |
| 326 | LRUHandle* e = lru_.next; |
| 327 | assert(e->refs == 1); |
| 328 | bool erased = FinishErase(table_.Remove(e->key(), e->hash)); |
| 329 | if (!erased) { // to avoid unused variable when compiled NDEBUG |
| 330 | assert(erased); |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | static const int kNumShardBits = 4; |
| 336 | static const int kNumShards = 1 << kNumShardBits; |