MCPcopy Create free account
hub / github.com/ElementsProject/elements / Prune

Method Prune

src/leveldb/util/cache.cc:323–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323void 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
335static const int kNumShardBits = 4;
336static const int kNumShards = 1 << kNumShardBits;

Callers 2

TESTFunction · 0.45
PruneMethod · 0.45

Calls 2

RemoveMethod · 0.80
keyMethod · 0.45

Tested by 1

TESTFunction · 0.36