| 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) |
nothing calls this directly
no test coverage detected