mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Move Set/GetThreadName() to Tracy API.
This commit is contained in:
parent
2377911313
commit
a90004b983
@ -870,7 +870,7 @@ TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue();
|
||||
|
||||
struct RPMallocInit { RPMallocInit() { rpmalloc_initialize(); } };
|
||||
|
||||
TRACY_API void InitRPMallocThread()
|
||||
void InitRPMallocThread()
|
||||
{
|
||||
rpmalloc_initialize();
|
||||
rpmalloc_thread_initialize();
|
||||
@ -941,14 +941,14 @@ TRACY_API std::atomic<uint32_t>& GetLockCounter() { return GetProfilerData().loc
|
||||
TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter() { return GetProfilerData().gpuCtxCounter; }
|
||||
TRACY_API GpuCtxWrapper& GetGpuCtx() { return GetProfilerThreadData().gpuCtx; }
|
||||
TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData() { return GetProfilerData().threadNameData; }
|
||||
std::atomic<ThreadNameData*>& GetThreadNameData() { return GetProfilerData().threadNameData; }
|
||||
|
||||
# ifdef TRACY_ON_DEMAND
|
||||
TRACY_API LuaZoneState& GetLuaZoneState() { return GetProfilerThreadData().luaZoneState; }
|
||||
# endif
|
||||
|
||||
#else
|
||||
TRACY_API void InitRPMallocThread()
|
||||
void InitRPMallocThread()
|
||||
{
|
||||
rpmalloc_thread_initialize();
|
||||
}
|
||||
@ -1003,7 +1003,7 @@ TRACY_API uint64_t GetThreadHandle() { return detail::GetThreadHandleImpl(); }
|
||||
TRACY_API uint64_t GetThreadHandle() { return s_threadHandle.val; }
|
||||
# endif
|
||||
|
||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData() { return s_threadNameData; }
|
||||
std::atomic<ThreadNameData*>& GetThreadNameData() { return s_threadNameData; }
|
||||
|
||||
# ifdef TRACY_ON_DEMAND
|
||||
TRACY_API LuaZoneState& GetLuaZoneState() { return s_luaZoneState; }
|
||||
|
@ -58,7 +58,7 @@ TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter();
|
||||
TRACY_API GpuCtxWrapper& GetGpuCtx();
|
||||
TRACY_API uint64_t GetThreadHandle();
|
||||
|
||||
TRACY_API void InitRPMallocThread();
|
||||
void InitRPMallocThread();
|
||||
|
||||
struct SourceLocationData
|
||||
{
|
||||
|
@ -48,11 +48,11 @@ struct ThreadNameData
|
||||
const char* name;
|
||||
ThreadNameData* next;
|
||||
};
|
||||
TRACY_API std::atomic<ThreadNameData*>& GetThreadNameData();
|
||||
TRACY_API void InitRPMallocThread();
|
||||
std::atomic<ThreadNameData*>& GetThreadNameData();
|
||||
void InitRPMallocThread();
|
||||
#endif
|
||||
|
||||
void SetThreadName( const char* name )
|
||||
TRACY_API void SetThreadName( const char* name )
|
||||
{
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
# if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2
|
||||
@ -118,7 +118,7 @@ void SetThreadName( const char* name )
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* GetThreadName( uint64_t id )
|
||||
TRACY_API const char* GetThreadName( uint64_t id )
|
||||
{
|
||||
static char buf[256];
|
||||
#ifdef TRACY_ENABLE
|
||||
|
@ -72,8 +72,8 @@ static inline uint64_t GetThreadHandle()
|
||||
}
|
||||
#endif
|
||||
|
||||
void SetThreadName( const char* name );
|
||||
const char* GetThreadName( uint64_t id );
|
||||
TRACY_API void SetThreadName( const char* name );
|
||||
TRACY_API const char* GetThreadName( uint64_t id );
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user