| 180 | } |
| 181 | |
| 182 | TensorPoolAllocator::Bin* TensorPoolAllocator::GetBin( |
| 183 | size_t bin_index) { |
| 184 | if (unlikely(bin_index < 0)) { |
| 185 | return nullptr; |
| 186 | } |
| 187 | |
| 188 | if (unlikely(bin_index >= large_bin_index_)) { |
| 189 | auto it = large_lifetime_bins_.find(bin_index); |
| 190 | if (it == large_lifetime_bins_.end()) { |
| 191 | return nullptr; |
| 192 | } else { |
| 193 | return it->second; |
| 194 | } |
| 195 | } |
| 196 | return lifetime_bins_[bin_index]; |
| 197 | } |
| 198 | |
| 199 | TensorPoolAllocator::Bin::Bin(size_t len, |
| 200 | size_t chunk_size, size_t alignment, |
no test coverage detected