mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add cached thread retriever.
This commit is contained in:
parent
06bc802107
commit
5873561b54
@ -2654,6 +2654,21 @@ ThreadData* Worker::NoticeThreadReal( uint64_t thread )
|
||||
}
|
||||
}
|
||||
|
||||
ThreadData* Worker::RetrieveThreadReal( uint64_t thread )
|
||||
{
|
||||
auto it = m_threadMap.find( thread );
|
||||
if( it != m_threadMap.end() )
|
||||
{
|
||||
m_data.threadDataLast.first = thread;
|
||||
m_data.threadDataLast.second = it->second;
|
||||
return it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const ThreadData* Worker::GetThreadData( uint64_t tid ) const
|
||||
{
|
||||
auto it = m_threadMap.find( tid );
|
||||
|
@ -482,11 +482,17 @@ private:
|
||||
|
||||
ThreadData* NoticeThreadReal( uint64_t thread );
|
||||
ThreadData* NewThread( uint64_t thread );
|
||||
ThreadData* NoticeThread( uint64_t thread )
|
||||
tracy_force_inline ThreadData* NoticeThread( uint64_t thread )
|
||||
{
|
||||
if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;
|
||||
return NoticeThreadReal( thread );
|
||||
}
|
||||
ThreadData* RetrieveThreadReal( uint64_t thread );
|
||||
tracy_force_inline ThreadData* RetrieveThread( uint64_t thread )
|
||||
{
|
||||
if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;
|
||||
return RetrieveThreadReal( thread );
|
||||
}
|
||||
|
||||
tracy_force_inline void NewZone( ZoneEvent* zone, uint64_t thread );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user