mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-01 16:08:30 +00:00
Mangle the GetToken accessor based on config.
The macro fast paths only reference GetProfiler from -O0 code, direct calls, and ON_DEMAND builds: the single GetProfiler() call on the macro path sits behind the constexpr-dead callstack guard and is folded away at -O1+, so Release builds carried no config fingerprint and mismatched clients linked silently. GetToken is the hot-path binding of every queueing macro and is referenced at all optimization levels; mangle it the same way so mismatches fail at link time in Release builds too.
This commit is contained in:
@@ -1380,7 +1380,7 @@ static ProfilerThreadData& GetProfilerThreadData()
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* GetToken() { return GetProfilerThreadData().token.ptr; }
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* MANGLED_NAME_BASED_ON_CONFIG(GetToken)() { return GetProfilerThreadData().token.ptr; }
|
||||
TRACY_API Profiler& MANGLED_NAME_BASED_ON_CONFIG(GetProfiler)() { return GetProfilerData().profiler; }
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue() { return GetProfilerData().queue; }
|
||||
TRACY_API int64_t GetInitTime() { return GetProfilerData().initTime; }
|
||||
@@ -1485,7 +1485,7 @@ thread_local LuaZoneState init_order(104) s_luaZoneState { 0, false };
|
||||
|
||||
static Profiler init_order(105) s_profiler;
|
||||
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* GetToken() { return s_token.ptr; }
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* MANGLED_NAME_BASED_ON_CONFIG(GetToken)() { return s_token.ptr; }
|
||||
TRACY_API Profiler& MANGLED_NAME_BASED_ON_CONFIG(GetProfiler)() { return s_profiler; }
|
||||
TRACY_API moodycamel::ConcurrentQueue<QueueItem>& GetQueue() { return s_queue; }
|
||||
TRACY_API int64_t GetInitTime() { return s_initTime.val; }
|
||||
|
||||
Reference in New Issue
Block a user