mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Initialize rpmalloc in profiler worker thread.
Thread local variables on gcc are apparently not initialized on thread startup, but on first access to thread local variables block. Previously it was working, because s_token was accessed before any rpmalloc allocation could be performed. Now the first rpmalloc allocation is the Socket class, and rpmalloc is not initialized there, as there was no thread local access yet.
This commit is contained in:
parent
c5eef172f1
commit
1e645665fe
@ -154,6 +154,8 @@ enum { BulkSize = TargetFrameSize / QueueItemSize };
|
|||||||
|
|
||||||
void Profiler::Worker()
|
void Profiler::Worker()
|
||||||
{
|
{
|
||||||
|
rpmalloc_thread_initialize();
|
||||||
|
|
||||||
const auto procname = GetProcessName();
|
const auto procname = GetProcessName();
|
||||||
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
const auto pnsz = std::min<size_t>( strlen( procname ), WelcomeMessageProgramNameSize - 1 );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user