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

Method DeallocateRaw

tensorflow/core/common_runtime/tensorpool_allocator.cc:167–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void 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
182TensorPoolAllocator::Bin* TensorPoolAllocator::GetBin(
183 size_t bin_index) {

Callers 2

DeallocateMethod · 0.45
FreeMethod · 0.45

Calls 4

GetLightHeaderFunction · 0.85
GetHeaderFunction · 0.85
FreeMethod · 0.45
DeallocateMethod · 0.45

Tested by

no test coverage detected