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

Method release

cachelib/interface/components/FlashCacheComponent.cpp:660–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void FlashCacheComponent::release(CacheItem& item, bool inserted) {
661 stats_->release_.throughput_.calls_.inc();
662 auto latencyGuard = stats_->release_.latency_.start();
663 auto& fccItem = static_cast<FlashCacheItem&>(item);
664 if (!inserted) {
665 cache_->addHole(fccItem.getTotalSize());
666 }
667 if (fccItem.isAllocPath() && fccItem.getRegionDescriptor().isReady()) {
668 cache_->regionManager_.close(std::move(fccItem.getRegionDescriptor()));
669 }
670 // Item is stored inline in the Handle's buffer; destroy without deallocating
671 item.~CacheItem();
672 stats_->release_.throughput_.successes_.inc();
673}
674
675UnitResult FlashCacheComponent::shutdown() {
676 try {

Callers

nothing calls this directly

Calls 8

addHoleMethod · 0.80
isAllocPathMethod · 0.80
~CacheItemMethod · 0.80
incMethod · 0.45
startMethod · 0.45
getTotalSizeMethod · 0.45
isReadyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected