From 6a4e58b545b8614706529ae1be33df0f114e5fef Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 24 Mar 2018 01:31:58 +0100 Subject: [PATCH] Force inline compress/decompress thread id. --- server/TracyWorker.cpp | 13 ++++++------- server/TracyWorker.hpp | 5 +++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index c39656bd..699295fa 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -436,17 +436,16 @@ uint16_t Worker::CompressThread( uint64_t thread ) } else { - auto sz = m_data.threadExpand.size(); - m_data.threadExpand.push_back( thread ); - m_data.threadMap.emplace( thread, sz ); - return sz; + return CompressThreadNew( thread ); } } -uint64_t Worker::DecompressThread( uint16_t thread ) const +uint16_t Worker::CompressThreadNew( uint64_t thread ) { - assert( thread < m_data.threadExpand.size() ); - return m_data.threadExpand[thread]; + auto sz = m_data.threadExpand.size(); + m_data.threadExpand.push_back( thread ); + m_data.threadMap.emplace( thread, sz ); + return sz; } void Worker::Exec() diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 3a08687a..624172c1 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -129,8 +129,8 @@ public: const SourceLocationZones& GetZonesForSourceLocation( int32_t srcloc ) const; #endif - uint16_t CompressThread( uint64_t thread ); - uint64_t DecompressThread( uint16_t thread ) const; + tracy_force_inline uint16_t CompressThread( uint64_t thread ); + tracy_force_inline uint64_t DecompressThread( uint16_t thread ) const { assert( thread < m_data.threadExpand.size() ); return m_data.threadExpand[thread]; } NonRecursiveBenaphore& GetMbpsDataLock() { return m_mbpsData.lock; } const std::vector& GetMbpsData() const { return m_mbpsData.mbps; } @@ -199,6 +199,7 @@ private: void HandlePostponedPlots(); StringLocation StoreString( char* str, size_t sz ); + uint16_t CompressThreadNew( uint64_t thread ); tracy_force_inline void ReadTimeline( FileRead& f, Vector& vec, uint16_t thread ); tracy_force_inline void ReadTimeline( FileRead& f, Vector& vec );