| 205 | } |
| 206 | |
| 207 | void MgrMapCache<PyObject*>::erase(std::string_view key) noexcept { |
| 208 | if (!this->is_cacheable(key)) return; |
| 209 | PyObject* o = nullptr; |
| 210 | if (!this->extract(key, &o)) return; |
| 211 | |
| 212 | Py_AddPendingCall(+[](void* p){ Py_DECREF((PyObject*)p); return 0; }, o); |
| 213 | dout(20) << ": erased key: " << key |
| 214 | << " hit/miss:" |
| 215 | << CacheImp::get_hits() << "/" |
| 216 | << CacheImp::get_misses() << dendl; |
| 217 | } |
| 218 | |
| 219 | void MgrMapCache<PyObject*>::clear() noexcept { |
| 220 | std::vector<PyObject*> to_drop; |
no test coverage detected