| 36 | } |
| 37 | |
| 38 | void Free(void* ptr) { |
| 39 | if (ptr == nullptr) { |
| 40 | return; |
| 41 | } |
| 42 | auto it = allocated_blocks_.find(ptr); |
| 43 | if (it != allocated_blocks_.end()) { |
| 44 | allocated_blocks_.erase(it); |
| 45 | free(ptr); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void Reset() { |
| 50 | for (auto& [ptr, size] : allocated_blocks_) { |
no test coverage detected