| 390 | } |
| 391 | |
| 392 | void TensorPoolAllocator::BigDeallocate(Header* header) { |
| 393 | auto ptr = header->raw_ptr; |
| 394 | auto num_bytes = header->total_size; |
| 395 | if (!inited_.load()) { |
| 396 | mem_planner_->TrackDeallocate(header); |
| 397 | sub_allocator_->Free(ptr, num_bytes); |
| 398 | return; |
| 399 | } |
| 400 | |
| 401 | if (header->bin == nullptr) { |
| 402 | sub_allocator_->Free(ptr, num_bytes); |
| 403 | return; |
| 404 | } |
| 405 | |
| 406 | auto bin = (Bin*) (header->bin); |
| 407 | bin->Deallocate(header); |
| 408 | } |
| 409 | |
| 410 | class TensorPoolAllocatorFactory : public AllocatorFactory { |
| 411 | public: |
nothing calls this directly
no test coverage detected