From b64389ba15c18a63ec77f6ecd085e38653ef9be8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 5 May 2024 20:59:25 +0200 Subject: [PATCH] Display memory limit in notification area. --- profiler/src/profiler/TracyView.cpp | 12 ++++++++++++ server/TracyWorker.hpp | 1 + 2 files changed, 13 insertions(+) diff --git a/profiler/src/profiler/TracyView.cpp b/profiler/src/profiler/TracyView.cpp index e9746215..2bcb60f4 100644 --- a/profiler/src/profiler/TracyView.cpp +++ b/profiler/src/profiler/TracyView.cpp @@ -997,6 +997,18 @@ bool View::DrawImpl() dx = ImGui::GetCursorPosX() - cx; if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize ); ImGui::Spacing(); + + if( m_worker.GetMemoryLimit() > 0 ) + { + ImGui::SameLine(); + TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION ); + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + ImGui::Text( "Memory limit: %s", MemSizeToString( m_worker.GetMemoryLimit() ) ); + ImGui::EndTooltip(); + } + } } DrawNotificationArea(); diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 2b73472e..f921facb 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -643,6 +643,7 @@ public: void Shutdown() { m_shutdown.store( true, std::memory_order_relaxed ); } void Disconnect(); bool WasDisconnectIssued() const { return m_disconnect; } + int64_t GetMemoryLimit() const { return m_memoryLimit; } void Write( FileWrite& f, bool fiDict ); int GetTraceVersion() const { return m_traceVersion; }