MCPcopy Create free account
hub / github.com/apache/trafficserver / alloc

Method alloc

include/tscore/Allocator.h:401–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399 }
400
401 C *
402 alloc()
403 {
404 void *callstack[3];
405 int frames = backtrace(callstack, 3);
406 C *ptr = ClassAllocator<C, Destruct_on_free>::alloc();
407
408 const void *symbol = nullptr;
409 if (frames == 3 && callstack[2] != nullptr) {
410 symbol = callstack[2];
411 }
412
413 tracker.increment(symbol, (int64_t)sizeof(C), this->fl->name);
414 ink_mutex_acquire(&trackerLock);
415 reverse_lookup[ptr] = symbol;
416 ++allocations;
417 ink_mutex_release(&trackerLock);
418
419 return ptr;
420 }
421
422 void
423 free(C *ptr)

Callers

nothing calls this directly

Calls 3

ink_mutex_acquireFunction · 0.85
ink_mutex_releaseFunction · 0.85
incrementMethod · 0.45

Tested by

no test coverage detected