| 49 | bool BufferedAllocator::IsAllocThreadSafe() const { return mtx_ != nullptr; } |
| 50 | |
| 51 | void BufferedAllocator::FreeImpl(phi::Allocation *allocation) { |
| 52 | platform::LockGuardPtr<std::mutex> guard(mtx_); |
| 53 | allocations_.emplace(allocation->size(), |
| 54 | AllocationPtr(allocation, Allocator::AllocationDeleter)); |
| 55 | } |
| 56 | |
| 57 | phi::Allocation *BufferedAllocator::AllocateImpl(size_t size) { |
| 58 | { |