1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Implement delayed initialization of the profiler.

Enabled on osx, ios.
This commit is contained in:
Bartosz Taudul
2019-02-19 20:43:14 +01:00
parent d560f7a203
commit ef5e30056e
3 changed files with 153 additions and 55 deletions
+2 -1
View File
@@ -45,6 +45,7 @@ struct ThreadNameData
ThreadNameData* next;
};
std::atomic<ThreadNameData*>& GetThreadNameData();
void InitRPMallocThread();
#endif
void SetThreadName( std::thread& thread, const char* name )
@@ -104,7 +105,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
#endif
#ifdef TRACY_COLLECT_THREAD_NAMES
{
rpmalloc_thread_initialize();
InitRPMallocThread();
const auto sz = strlen( name );
char* buf = (char*)tracy_malloc( sz+1 );
memcpy( buf, name, sz );