summaryrefslogtreecommitdiff
path: root/runtime/contrib/heap_trace/src/valloc_stub.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/contrib/heap_trace/src/valloc_stub.cc')
-rw-r--r--runtime/contrib/heap_trace/src/valloc_stub.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/contrib/heap_trace/src/valloc_stub.cc b/runtime/contrib/heap_trace/src/valloc_stub.cc
index 24e91bd11..344591630 100644
--- a/runtime/contrib/heap_trace/src/valloc_stub.cc
+++ b/runtime/contrib/heap_trace/src/valloc_stub.cc
@@ -16,6 +16,7 @@
#include "trace.h"
#include "function_resolver.h"
+#include "memory_pool_for_symbol_searcher_internals.h"
#include <memory>
@@ -27,6 +28,11 @@ void *valloc(size_t sz) noexcept
{
static auto isOriginalFunctionCallSuccessful = [](void *result) -> bool { return result; };
+ if (isCurrentAllocationForSymbolSearcherInternalUsage())
+ {
+ return MemoryPoolForSymbolSearcherInternals{}.allocate(sz);
+ }
+
static auto originalFunction = findFunctionByName<void *, size_t>("valloc");
void *result = originalFunction(sz);
if (isOriginalFunctionCallSuccessful(result) && !Trace::Guard{}.isActive())