void HeapProfiler::malloc(void *ptr, size_t size, const StackTrace &trace){ std::lock_guard<std::mutex> lk(mutex); fprintf(data.output, "+ %lx %lx %lx\n", size, trace.index(), reinterpret_cast<uintptr_t>(ptr)); data.tick(); // Store the stracktrace hash of this allocation in the pointers map. ptrs[ptr] = trace.hash; }