diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 522ef7e9..fa480771 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -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(); - 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(); + 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 ) diff --git a/server/TracyView.hpp b/server/TracyView.hpp index d243b7aa..9e1b5764 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -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 );