| 75 | std::unordered_map<void*, std::weak_ptr<void>> cache; |
| 76 | std::mutex m; |
| 77 | std::shared_ptr<void> get(void* ptr) |
| 78 | { |
| 79 | std::lock_guard<std::mutex> lock(m); |
| 80 | auto it = cache.find(ptr); |
| 81 | if(it != cache.end()) |
| 82 | return it->second.lock(); |
| 83 | return nullptr; |
| 84 | } |
| 85 | |
| 86 | void put(const std::shared_ptr<void>& p) |
| 87 | { |
no test coverage detected