From 9fabafbeca01144f2ff20c4adb8925bcd8fbde2b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 19 Feb 2019 18:45:41 +0100 Subject: [PATCH] Fix DLL code. --- TracyClientDLL.cpp | 15 +++++++++++++++ client/TracyProfiler.cpp | 11 ++++++++++- client/TracyProfiler.hpp | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/TracyClientDLL.cpp b/TracyClientDLL.cpp index 6e3023d0..2132767d 100644 --- a/TracyClientDLL.cpp +++ b/TracyClientDLL.cpp @@ -30,6 +30,8 @@ namespace tracy DLL_IMPORT void*(*get_rpmalloc())(size_t size); DLL_IMPORT void(*get_rpfree())(void* ptr); + DLL_IMPORT moodycamel::ConcurrentQueue::ExplicitProducer*(*get_token())(); + DLL_IMPORT Profiler&(*get_profiler())(); #if defined TRACY_HW_TIMER && __ARM_ARCH >= 6 DLL_IMPORT int64_t(*get_GetTimeImpl())(); @@ -52,6 +54,8 @@ namespace tracy static void*(*rpmalloc_fpt)(size_t size) = get_rpmalloc(); static void(*rpfree_fpt)(void* ptr) = get_rpfree(); + static moodycamel::ConcurrentQueue::ExplicitProducer*(*GetToken_fpt)() = get_token; + static Profiler&(*GetProfiler_fpt)() = get_profiler(); RPMALLOC_RESTRICT void* rpmalloc(size_t size) { @@ -62,6 +66,17 @@ namespace tracy { rpfree_fpt(ptr); } + + moodycamel::ConcurrentQueue::ExplicitProducer* GetToken() + { + return GetToken_fpt(); + } + + Profiler& GetProfiler() + { + return GetProfiler_fpt(); + } + } #endif diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 4175df08..bde79e07 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -768,7 +768,7 @@ static Profiler init_order(105) s_profiler; #endif -tracy::moodycamel::ConcurrentQueue::ExplicitProducer* GetToken() +moodycamel::ConcurrentQueue::ExplicitProducer* GetToken() { return s_token.ptr; } @@ -790,6 +790,15 @@ DLL_EXPORT void(*get_rpfree())(void* ptr) return rpfree; } +DLL_EXPORT moodycamel::ConcurrentQueue::ExplicitProducer*(*get_token())() +{ + return GetToken; +} + +DLL_EXPORT Profiler&(*get_profiler())() +{ + return GetProfiler; +} #if defined TRACY_HW_TIMER && __ARM_ARCH >= 6 DLL_EXPORT int64_t(*get_GetTimeImpl())() diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index f3100740..3fdd572c 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -52,7 +52,7 @@ struct SourceLocationData uint32_t color; }; -tracy::moodycamel::ConcurrentQueue::ExplicitProducer* GetToken(); +moodycamel::ConcurrentQueue::ExplicitProducer* GetToken(); Profiler& GetProfiler(); class GpuCtx; @@ -69,7 +69,7 @@ struct LuaZoneState }; #endif -using Magic = tracy::moodycamel::ConcurrentQueueDefaultTraits::index_t; +using Magic = moodycamel::ConcurrentQueueDefaultTraits::index_t; #if __ARM_ARCH >= 6 extern int64_t (*GetTimeImpl)();