MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / malloc_hook

Function malloc_hook

src/mallocTracer.cpp:35–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33static void* (*_orig_aligned_alloc)(size_t, size_t);
34
35extern "C" void* malloc_hook(size_t size) {
36 void* ret = _orig_malloc(size);
37 if (MallocTracer::running() && ret && size) {
38 MallocTracer::recordMalloc(ret, size);
39 }
40 return ret;
41}
42
43extern "C" void* calloc_hook(size_t num, size_t size) {
44 void* ret = _orig_calloc(num, size);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected