| 63 | } |
| 64 | |
| 65 | void MemPool::Clear() { |
| 66 | DFAKE_SCOPED_LOCK(mutex_); |
| 67 | current_chunk_idx_ = -1; |
| 68 | for (auto& chunk: chunks_) { |
| 69 | chunk.allocated_bytes = 0; |
| 70 | ASAN_POISON_MEMORY_REGION(chunk.data, chunk.size); |
| 71 | } |
| 72 | total_allocated_bytes_ = 0; |
| 73 | DCHECK(CheckIntegrity(false)); |
| 74 | } |
| 75 | |
| 76 | void MemPool::FreeAll() { |
| 77 | DFAKE_SCOPED_LOCK(mutex_); |
no outgoing calls