From 997f0c64c3afd4879c08dabad9f871f9aacc718d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 13 Sep 2017 01:24:42 +0200 Subject: [PATCH] Store pointers as uint64. Pointers can't be stored as pointers, as that would cause mismatch in wire protocol between 32 and 64 bit builds. --- client/TracyQueue.hpp | 5 +++-- client/TracyScoped.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/TracyQueue.hpp b/client/TracyQueue.hpp index 9486ecb8..1f3e91c1 100755 --- a/client/TracyQueue.hpp +++ b/client/TracyQueue.hpp @@ -18,8 +18,8 @@ enum class QueueType : uint8_t struct QueueZoneBegin { uint64_t id; - const char* filename; - const char* function; + uint64_t filename; // ptr + uint64_t function; // ptr uint32_t line; }; @@ -54,6 +54,7 @@ static const size_t QueueDataSize[] = { }; static_assert( sizeof( QueueDataSize ) / sizeof( size_t ) == (uint8_t)QueueType::NUM_TYPES, "QueueDataSize mismatch" ); +static_assert( sizeof( void* ) <= sizeof( uint64_t ), "Pointer size > 8 bytes" ); }; diff --git a/client/TracyScoped.hpp b/client/TracyScoped.hpp index 6e501bb4..f7b7210a 100755 --- a/client/TracyScoped.hpp +++ b/client/TracyScoped.hpp @@ -14,7 +14,7 @@ public: ScopedZone( const char* file, const char* function, uint32_t line ) : m_id( Profiler::GetNewId() ) { - Profiler::ZoneBegin( QueueZoneBegin { m_id, file, function, line } ); + Profiler::ZoneBegin( QueueZoneBegin { m_id, (uint64_t)file, (uint64_t)function, line } ); } ~ScopedZone()