diff --git a/client/TracyLock.hpp b/client/TracyLock.hpp index 9745ff56..182a1bd6 100644 --- a/client/TracyLock.hpp +++ b/client/TracyLock.hpp @@ -2,6 +2,7 @@ #define __TRACYLOCK_HPP__ #include +#include #include "../common/TracySystem.hpp" #include "TracyProfiler.hpp" @@ -9,7 +10,7 @@ namespace tracy { -static std::atomic s_lockCounter( 0 ); +static std::atomic s_lockCounter( 0 ); template class Lockable @@ -19,6 +20,7 @@ public: : m_id( s_lockCounter.fetch_add( 1, std::memory_order_relaxed ) ) , m_lckloc( (uint64_t)srcloc ) { + assert( m_id != std::numeric_limits::max() ); } Lockable( const Lockable& ) = delete; @@ -106,7 +108,7 @@ public: private: T m_lockable; - uint64_t m_id; + uint32_t m_id; uint64_t m_lckloc; }; diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 4093f3e9..4947e1b9 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -78,7 +78,7 @@ struct QueueZoneName struct QueueLockWait { - uint64_t id; + uint32_t id; int64_t time; uint64_t thread; uint64_t lckloc; // ptr @@ -86,21 +86,21 @@ struct QueueLockWait struct QueueLockObtain { - uint64_t id; + uint32_t id; int64_t time; uint64_t thread; }; struct QueueLockRelease { - uint64_t id; + uint32_t id; int64_t time; uint64_t thread; }; struct QueueLockMark { - uint64_t id; + uint32_t id; uint64_t thread; uint64_t srcloc; // ptr }; @@ -176,6 +176,7 @@ static const size_t QueueDataSize[] = { sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // plot name }; +static_assert( QueueItemSize == 32, "Queue item size not 32 bytes" ); 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/server/TracyView.hpp b/server/TracyView.hpp index 82b5805d..1761062b 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -172,7 +172,7 @@ private: std::unordered_map m_threadNames; std::unordered_set m_customStrings; std::unordered_map m_sourceLocation; - std::unordered_map m_lockMap; + std::unordered_map m_lockMap; uint64_t m_zonesCnt; std::mutex m_mbpslock;