From d07db80b441ca196aaadeada42c9a558715fea6f Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 13 Jun 2021 12:15:36 +0200 Subject: [PATCH 1/3] Fix rpmalloc init for shared libraries. --- client/TracyAlloc.cpp | 9 ++++++++- common/TracyAlloc.hpp | 8 +------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/TracyAlloc.cpp b/client/TracyAlloc.cpp index eb94dd8d..0106a01a 100644 --- a/client/TracyAlloc.cpp +++ b/client/TracyAlloc.cpp @@ -3,15 +3,17 @@ #include #include "../common/TracyAlloc.hpp" +#include "../common/TracyForceInline.hpp" #include "../common/TracyYield.hpp" namespace tracy { +extern thread_local bool RpThreadInitDone; extern std::atomic RpInitDone; extern std::atomic RpInitLock; -TRACY_API void InitRpmallocPlumbing() +tracy_no_inline static void InitRpmallocPlumbing() { const auto done = RpInitDone.load( std::memory_order_acquire ); if( !done ) @@ -30,6 +32,11 @@ TRACY_API void InitRpmallocPlumbing() RpThreadInitDone = true; } +TRACY_API void InitRpmalloc() +{ + if( !RpThreadInitDone ) InitRpmallocPlumbing(); +} + } #endif diff --git a/common/TracyAlloc.hpp b/common/TracyAlloc.hpp index 27861c97..0ee01716 100644 --- a/common/TracyAlloc.hpp +++ b/common/TracyAlloc.hpp @@ -13,13 +13,7 @@ namespace tracy { #ifdef TRACY_ENABLE -extern thread_local bool RpThreadInitDone; -TRACY_API void InitRpmallocPlumbing(); - -static tracy_force_inline void InitRpmalloc() -{ - if( !RpThreadInitDone ) InitRpmallocPlumbing(); -} +TRACY_API void InitRpmalloc(); #endif static inline void* tracy_malloc( size_t size ) From 39e317f36de6a728a86a0c3adedd127600786326 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 14 Jun 2021 23:51:41 +0200 Subject: [PATCH 2/3] Fix display of messages with newlines. --- server/TracyView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 6b4ee9a0..b74800ae 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -9454,10 +9454,12 @@ void View::DrawMessageLine( const MessageData& msg, bool hasCallstack, int& idx ImGui::SameLine(); ImGui::TextDisabled( "(%s)", RealToString( tid ) ); ImGui::TableNextColumn(); + auto tend = text; + while( *tend != '\0' && *tend != '\n' ) tend++; ImGui::PushStyleColor( ImGuiCol_Text, msg.color ); const auto cw = ImGui::GetContentRegionAvail().x; - const auto tw = ImGui::CalcTextSize( text ).x; - ImGui::TextUnformatted( text ); + const auto tw = ImGui::CalcTextSize( text, tend ).x; + ImGui::TextUnformatted( text, tend ); if( tw > cw && ImGui::IsItemHovered() ) { ImGui::SetNextWindowSize( ImVec2( 1000, 0 ) ); From 5834a4be4413372e9ad8985753a1aaf5e0e81209 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 14 Jun 2021 23:52:23 +0200 Subject: [PATCH 3/3] Update NEWS. --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 0b97bb43..181ed3a3 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ v0.x.x (xxxx-xx-xx) - Improved function matching algorithm in compare traces view. - Added minimal CMake integration layer. - Reworked rpmalloc initialization. +- Fixed display of messages with newlines on messages list. v0.7.8 (2021-05-19)