Force inline compress/decompress thread id.

This commit is contained in:
Bartosz Taudul 2018-03-24 01:31:58 +01:00
parent c0577fd5b2
commit 6a4e58b545
2 changed files with 9 additions and 9 deletions

View File

@ -436,17 +436,16 @@ uint16_t Worker::CompressThread( uint64_t thread )
} }
else else
{ {
return CompressThreadNew( thread );
}
}
uint16_t Worker::CompressThreadNew( uint64_t thread )
{
auto sz = m_data.threadExpand.size(); auto sz = m_data.threadExpand.size();
m_data.threadExpand.push_back( thread ); m_data.threadExpand.push_back( thread );
m_data.threadMap.emplace( thread, sz ); m_data.threadMap.emplace( thread, sz );
return sz; return sz;
}
}
uint64_t Worker::DecompressThread( uint16_t thread ) const
{
assert( thread < m_data.threadExpand.size() );
return m_data.threadExpand[thread];
} }
void Worker::Exec() void Worker::Exec()

View File

@ -129,8 +129,8 @@ public:
const SourceLocationZones& GetZonesForSourceLocation( int32_t srcloc ) const; const SourceLocationZones& GetZonesForSourceLocation( int32_t srcloc ) const;
#endif #endif
uint16_t CompressThread( uint64_t thread ); tracy_force_inline uint16_t CompressThread( uint64_t thread );
uint64_t DecompressThread( uint16_t thread ) const; 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; } NonRecursiveBenaphore& GetMbpsDataLock() { return m_mbpsData.lock; }
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; } const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }
@ -199,6 +199,7 @@ private:
void HandlePostponedPlots(); void HandlePostponedPlots();
StringLocation StoreString( char* str, size_t sz ); StringLocation StoreString( char* str, size_t sz );
uint16_t CompressThreadNew( uint64_t thread );
tracy_force_inline void ReadTimeline( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread ); tracy_force_inline void ReadTimeline( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread );
tracy_force_inline void ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec ); tracy_force_inline void ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec );