MCPcopy Create free account
hub / github.com/OAID/Tengine / Free

Method Free

driver/cpu/cpu_runner.cpp:206–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204 }
205
206 void Free(Tensor* tensor)
207 {
208 void* addr = get_tensor_mem(tensor);
209
210 if(addr_map.count(addr) == 0)
211 return;
212
213 auto ir = addr_map.find(addr);
214
215 int idx = ir->second;
216
217 MemBlock* p_block = &block_list[idx];
218
219 p_block->ref_count--;
220
221 if(p_block->ref_count == 0)
222 {
223 addr_map.erase(ir);
224 }
225 }
226
227 mem_alloc_t mem_alloc;
228 mem_free_t mem_free;

Callers 1

AllocateMemMethod · 0.80

Calls 1

get_tensor_memFunction · 0.85

Tested by

no test coverage detected