mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Split heavy used functions into check and add parts.
This commit is contained in:
parent
89448b473e
commit
7a4c6b3d68
@ -1058,13 +1058,18 @@ uint32_t View::ShrinkSourceLocation( uint64_t srcloc )
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto sz = m_sourceLocationExpand.size();
|
||||
m_sourceLocationExpand.push_back( srcloc );
|
||||
m_sourceLocationShrink.emplace( srcloc, sz );
|
||||
return sz;
|
||||
return NewShrinkedSourceLocation( srcloc );
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t View::NewShrinkedSourceLocation( uint64_t srcloc )
|
||||
{
|
||||
const auto sz = m_sourceLocationExpand.size();
|
||||
m_sourceLocationExpand.push_back( srcloc );
|
||||
m_sourceLocationShrink.emplace( srcloc, sz );
|
||||
return sz;
|
||||
}
|
||||
|
||||
void View::InsertMessageData( MessageData* msg, uint64_t thread )
|
||||
{
|
||||
if( m_messages.empty() || m_messages.back()->time < msg->time )
|
||||
@ -1092,22 +1097,27 @@ void View::InsertMessageData( MessageData* msg, uint64_t thread )
|
||||
ThreadData* View::NoticeThread( uint64_t thread )
|
||||
{
|
||||
auto it = m_threadMap.find( thread );
|
||||
if( it == m_threadMap.end() )
|
||||
{
|
||||
CheckThreadString( thread );
|
||||
auto td = m_slab.AllocInit<ThreadData>();
|
||||
td->id = thread;
|
||||
td->count = 0;
|
||||
td->showFull = true;
|
||||
td->visible = true;
|
||||
m_threads.push_back( td );
|
||||
m_threadMap.emplace( thread, td );
|
||||
return td;
|
||||
}
|
||||
else
|
||||
if( it != m_threadMap.end() )
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NewThread( thread );
|
||||
}
|
||||
}
|
||||
|
||||
ThreadData* View::NewThread( uint64_t thread )
|
||||
{
|
||||
CheckThreadString( thread );
|
||||
auto td = m_slab.AllocInit<ThreadData>();
|
||||
td->id = thread;
|
||||
td->count = 0;
|
||||
td->showFull = true;
|
||||
td->visible = true;
|
||||
m_threads.push_back( td );
|
||||
m_threadMap.emplace( thread, td );
|
||||
return td;
|
||||
}
|
||||
|
||||
void View::NewZone( ZoneEvent* zone, uint64_t thread )
|
||||
|
||||
@ -83,10 +83,12 @@ private:
|
||||
StringLocation StoreString( char* str, size_t sz );
|
||||
|
||||
uint32_t ShrinkSourceLocation( uint64_t srcloc );
|
||||
uint32_t NewShrinkedSourceLocation( uint64_t srcloc );
|
||||
|
||||
void InsertMessageData( MessageData* msg, uint64_t thread );
|
||||
|
||||
ThreadData* NoticeThread( uint64_t thread );
|
||||
ThreadData* NewThread( uint64_t thread );
|
||||
|
||||
void NewZone( ZoneEvent* zone, uint64_t thread );
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user