MCPcopy Create free account
hub / github.com/apache/trafficserver / dealloc_entry

Method dealloc_entry

src/iocore/hostdb/P_RefCountCache.h:266–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264
265template <class C>
266void
267RefCountCachePartition<C>::dealloc_entry(hash_type::iterator ptr)
268{
269 // decrement usage are not cleaned up. The values are not touched in this method, therefore it is safe
270 // counters
271 this->size -= ptr->meta.size;
272 this->items--;
273
274 Metrics::Gauge::decrement(this->rsb->refcountcache_current_size, ptr->meta.size);
275 Metrics::Gauge::decrement(this->rsb->refcountcache_current_items);
276
277 // remove from expiry queue
278 if (ptr->expiry_entry != nullptr) {
279 Dbg(dbg_ctl, "partition %d deleting item from expiry_queue idx=%d", this->part_num, ptr->expiry_entry->index);
280
281 this->expiry_queue.erase(ptr->expiry_entry);
282 expiryQueueEntry.free(ptr->expiry_entry);
283 ptr->expiry_entry = nullptr; // To avoid the destruction of `l` calling the destructor again-- and causing issues
284 }
285
286 RefCountCacheHashEntry::free<C>(ptr);
287}
288
289template <class C>
290void

Callers 2

eraseMethod · 0.95
clearMethod · 0.95

Calls 2

eraseMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected