From 813e265bc3e6aa7615b11b3ef60e66b43dcaa5af Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 30 Mar 2018 14:39:25 +0200 Subject: [PATCH] Initialize rpmalloc in SetThreadName(). There's no guarantee that rpmalloc will be initialized when the thread calls SetThreadName, due to thread_local storage initialization rules. --- common/TracySystem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index 96737209..c593c695 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -84,6 +84,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name ) #endif #ifdef TRACY_COLLECT_THREAD_NAMES { + rpmalloc_thread_initialize(); const auto sz = strlen( name ); char* buf = (char*)tracy_malloc( sz+1 ); memcpy( buf, name, sz );