| 165 | } |
| 166 | |
| 167 | void TensorPoolAllocator::DeallocateRaw(void* ptr) { |
| 168 | auto light_header = GetLightHeader(ptr); |
| 169 | if (light_header != nullptr) { |
| 170 | auto header_size = light_header->header_size; |
| 171 | auto raw_ptr = static_cast<char*>(ptr) - header_size; |
| 172 | // LightHeader not record allocation size |
| 173 | // Free interface ignore the freed num_bytes |
| 174 | sub_allocator_->Free(raw_ptr, 0); |
| 175 | return; |
| 176 | } |
| 177 | |
| 178 | auto header = GetHeader(ptr); |
| 179 | BigDeallocate(header); |
| 180 | } |
| 181 | |
| 182 | TensorPoolAllocator::Bin* TensorPoolAllocator::GetBin( |
| 183 | size_t bin_index) { |
no test coverage detected