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

Method release

cachelib/interface/components/RAMCacheComponent.cpp:452–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void RAMCacheComponent::release(interface::CacheItem& item, bool inserted) {
453 stats_->release_.throughput_.calls_.inc();
454 auto latencyGuard = stats_->release_.latency_.start();
455 auto& genericItem = reinterpret_cast<RAMCacheItem&>(item);
456 auto* implItem = genericItem.item();
457 // call this destructor first since genericItem is embedded in implItem
458 genericItem.~RAMCacheItem();
459 cache_->releaseBackToAllocator(*implItem, RemoveContext::kNormal,
460 /* nascent */ !inserted);
461 stats_->release_.throughput_.successes_.inc();
462}
463
464UnitResult RAMCacheComponent::shutdown() {
465 if (persist_) {

Callers 1

toGenericHandleFunction · 0.45

Calls 4

itemMethod · 0.80
incMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected