mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-08 03:18:21 +00:00
fix: don't truncate thread names to 15 chars on Apple platforms
This commit is contained in:
@@ -168,26 +168,22 @@ TRACY_API void SetThreadNameWithHint( const char* name, int32_t groupHint )
|
||||
}
|
||||
#elif defined _GNU_SOURCE && !defined __EMSCRIPTEN__
|
||||
{
|
||||
#if defined __APPLE__
|
||||
pthread_setname_np( name );
|
||||
#else
|
||||
const auto sz = strlen( name );
|
||||
if( sz <= 15 )
|
||||
{
|
||||
#if defined __APPLE__
|
||||
pthread_setname_np( name );
|
||||
#else
|
||||
pthread_setname_np( pthread_self(), name );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[16];
|
||||
memcpy( buf, name, 15 );
|
||||
buf[15] = '\0';
|
||||
#if defined __APPLE__
|
||||
pthread_setname_np( buf );
|
||||
#else
|
||||
pthread_setname_np( pthread_self(), buf );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#elif defined __QNX__
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user