From 8d5f4d7363fab25a336611f181b6b3d5b2f5e1a4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 30 Jan 2020 19:38:05 +0100 Subject: [PATCH] Always use init once to initialize rpmalloc. --- client/TracyProfiler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 35981caf..6b6cbe24 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -104,7 +104,6 @@ extern "C" typedef BOOL (WINAPI *t_GetLogicalProcessorInformationEx)( LOGICAL_PR namespace tracy { -#ifndef TRACY_DELAYED_INIT namespace { # if ( defined _WIN32 || defined __CYGWIN__ ) && _WIN32_WINNT >= _WIN32_WINNT_VISTA @@ -144,6 +143,8 @@ struct RPMallocInit } }; +#ifndef TRACY_DELAYED_INIT + struct InitTimeWrapper { int64_t val; @@ -867,12 +868,11 @@ static Thread* s_sysTraceThread = nullptr; #ifdef TRACY_DELAYED_INIT struct ThreadNameData; TRACY_API moodycamel::ConcurrentQueue& GetQueue(); - -struct RPMallocInit { RPMallocInit() { rpmalloc_initialize(); } }; - TRACY_API void InitRPMallocThread() + +void InitRPMallocThread() { - rpmalloc_initialize(); + RPMallocInit rpinit; rpmalloc_thread_initialize(); }