MCPcopy Create free account
hub / github.com/facebook/CacheLib / release

Method release

cachelib/interface/tests/InterfaceTest.cpp:213–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 }
212
213 void release(CacheItem& item, bool inserted) override {
214 if (inserted) {
215 ASSERT_TRUE(cachedItems_.erase(item.getKey()) > 0 ||
216 removedItems_.contains(item.getKey()));
217 } else {
218 auto it = findAllocatedItem(&item);
219 ASSERT_NE(it, allocatedItems_.end());
220 allocatedItems_.erase(it);
221 }
222 delete &item;
223 }
224};
225
226class InterfaceTest : public ::testing::Test {

Callers

nothing calls this directly

Calls 3

eraseMethod · 0.80
getKeyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected