| 264 | |
| 265 | template <class C> |
| 266 | void |
| 267 | RefCountCachePartition<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 | |
| 289 | template <class C> |
| 290 | void |