From 7a138927546d22079882c6432bde0f27b98f31e0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 24 Nov 2017 01:05:42 +0100 Subject: [PATCH] Split srcloc check and creation. --- server/TracyView.cpp | 12 +++++++++++- server/TracyView.hpp | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e91585b9..e6c6fc40 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -939,8 +939,18 @@ static const SourceLocation emptySourceLocation = {}; void View::CheckSourceLocation( uint64_t ptr ) { - if( m_sourceLocation.find( ptr ) != m_sourceLocation.end() ) return; + if( m_sourceLocation.find( ptr ) != m_sourceLocation.end() ) + { + return; + } + else + { + NewSourceLocation( ptr ); + } +} +void View::NewSourceLocation( uint64_t ptr ) +{ m_sourceLocation.emplace( ptr, emptySourceLocation ); m_pendingSourceLocation++; m_sourceLocationQueue.push_back( ptr ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 4a2d08bd..1e0ab32f 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -79,7 +79,9 @@ private: void CheckString( uint64_t ptr ); void CheckThreadString( uint64_t id ); - void CheckSourceLocation( uint64_t ptr ); + + tracy_force_inline void CheckSourceLocation( uint64_t ptr ); + void NewSourceLocation( uint64_t ptr ); void AddString( uint64_t ptr, char* str, size_t sz ); void AddThreadString( uint64_t id, char* str, size_t sz );