| 288 | |
| 289 | template <class C> |
| 290 | void |
| 291 | RefCountCachePartition<C>::clear() |
| 292 | { |
| 293 | // Since the hash nodes embed the list pointers, you can't iterate over the |
| 294 | // hash elements and deallocate them, let alone remove them from the hash. |
| 295 | // Hence, this monstrosity. |
| 296 | auto it = this->item_map.begin(); |
| 297 | while (it != this->item_map.end()) { |
| 298 | auto cur = it++; |
| 299 | |
| 300 | this->item_map.erase(cur); |
| 301 | this->dealloc_entry(cur); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | // Are we full? |
| 306 | template <class C> |