From f4d80a4f5ff303862d43172fa0b23e6c1f619d9c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 31 May 2021 22:55:30 +0200 Subject: [PATCH] Fix rpmalloc init for TRACY_MANUAL_LIFETIME path. --- client/TracyProfiler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 6a722cd1..e3da7563 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -954,6 +954,10 @@ struct ProfilerThreadData # endif }; +std::atomic RpInitDone { 0 }; +std::atomic RpInitLock { 0 }; +thread_local bool RpThreadInitDone = false; + # ifdef TRACY_MANUAL_LIFETIME ProfilerData* s_profilerData = nullptr; TRACY_API void StartupProfiler() @@ -975,9 +979,6 @@ TRACY_API void ShutdownProfiler() rpmalloc_finalize(); } # else -std::atomic RpInitDone { 0 }; -std::atomic RpInitLock { 0 }; -thread_local bool RpThreadInitDone = false; static std::atomic profilerDataLock { 0 }; static std::atomic profilerData { nullptr };