1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Track zone id for verification purposes.

This commit is contained in:
Bartosz Taudul 2019-01-14 22:23:24 +01:00
parent a2fd09d938
commit 970108fbbf
2 changed files with 7 additions and 0 deletions

View File

@ -811,6 +811,7 @@ Profiler::Profiler()
, m_shutdownFinished( false ) , m_shutdownFinished( false )
, m_sock( nullptr ) , m_sock( nullptr )
, m_noExit( false ) , m_noExit( false )
, m_zoneId( 1 )
, m_stream( LZ4_createStream() ) , m_stream( LZ4_createStream() )
, m_buffer( (char*)tracy_malloc( TargetFrameSize*3 ) ) , m_buffer( (char*)tracy_malloc( TargetFrameSize*3 ) )
, m_bufferOffset( 0 ) , m_bufferOffset( 0 )

View File

@ -126,6 +126,11 @@ public:
#endif #endif
} }
tracy_force_inline uint32_t GetNextZoneId()
{
return m_zoneId.fetch_add( 1, std::memory_order_relaxed );
}
static tracy_force_inline void SendFrameMark() static tracy_force_inline void SendFrameMark()
{ {
#ifdef TRACY_ON_DEMAND #ifdef TRACY_ON_DEMAND
@ -431,6 +436,7 @@ private:
std::atomic<bool> m_shutdownFinished; std::atomic<bool> m_shutdownFinished;
Socket* m_sock; Socket* m_sock;
bool m_noExit; bool m_noExit;
std::atomic<uint32_t> m_zoneId;
LZ4_stream_t* m_stream; LZ4_stream_t* m_stream;
char* m_buffer; char* m_buffer;