MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Allocate

Method Allocate

tensorflow/core/common_runtime/tensorpool_allocator.cc:207–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void* TensorPoolAllocator::Bin::Allocate(size_t total, size_t header_size) {
208 auto ptr = buffer_.Allocate();
209 if (ptr != nullptr) {
210 return SetHeader(ptr, total, header_size, (void*)this, nullptr);
211 }
212 auto info = virtual_buffer_.Allocate();
213 if (info.first != nullptr) {
214 return SetHeader(info.first, total, header_size, (void*)this,
215 info.second);
216 }
217 return nullptr;
218}
219
220void TensorPoolAllocator::Bin::Deallocate(Header* header) {
221 if (header->internal_bin == nullptr) {

Callers 3

AllocateRawMethod · 0.45
BigAllocateMethod · 0.45
BigAllocateStatisticMethod · 0.45

Calls 4

SetHeaderFunction · 0.85
emptyMethod · 0.45
popMethod · 0.45
AllocateRawMethod · 0.45

Tested by

no test coverage detected