From 970108fbbf207520867c32fd9cedbe44b896650d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 14 Jan 2019 22:23:24 +0100 Subject: [PATCH] Track zone id for verification purposes. --- client/TracyProfiler.cpp | 1 + client/TracyProfiler.hpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 4f1b055e..c172704e 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -811,6 +811,7 @@ Profiler::Profiler() , m_shutdownFinished( false ) , m_sock( nullptr ) , m_noExit( false ) + , m_zoneId( 1 ) , m_stream( LZ4_createStream() ) , m_buffer( (char*)tracy_malloc( TargetFrameSize*3 ) ) , m_bufferOffset( 0 ) diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index f3f2ec6d..2947ef67 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -126,6 +126,11 @@ public: #endif } + tracy_force_inline uint32_t GetNextZoneId() + { + return m_zoneId.fetch_add( 1, std::memory_order_relaxed ); + } + static tracy_force_inline void SendFrameMark() { #ifdef TRACY_ON_DEMAND @@ -431,6 +436,7 @@ private: std::atomic m_shutdownFinished; Socket* m_sock; bool m_noExit; + std::atomic m_zoneId; LZ4_stream_t* m_stream; char* m_buffer;