mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
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.
This commit is contained in:
parent
045870ad95
commit
813e265bc3
@ -84,6 +84,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
|
|||||||
#endif
|
#endif
|
||||||
#ifdef TRACY_COLLECT_THREAD_NAMES
|
#ifdef TRACY_COLLECT_THREAD_NAMES
|
||||||
{
|
{
|
||||||
|
rpmalloc_thread_initialize();
|
||||||
const auto sz = strlen( name );
|
const auto sz = strlen( name );
|
||||||
char* buf = (char*)tracy_malloc( sz+1 );
|
char* buf = (char*)tracy_malloc( sz+1 );
|
||||||
memcpy( buf, name, sz );
|
memcpy( buf, name, sz );
|
||||||
|
Loading…
Reference in New Issue
Block a user