From b6ccb9d686a25c3d9ea76411e8fd0283c3756c76 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 17 Mar 2019 16:53:09 +0100 Subject: [PATCH] Allocation times may be displayed relative to zone start. --- server/TracyView.cpp | 4 +++- server/TracyView.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 28fe84aa..0b4161de 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4453,6 +4453,8 @@ void View::DrawZoneInfoWindow() if( ImGui::TreeNode( "Allocations list" ) ) { + SmallCheckbox( "Allocation times relative to zone start", &m_allocTimeRelativeToZone ); + std::vector v; v.reserve( nAlloc + nFree ); @@ -4480,7 +4482,7 @@ void View::DrawZoneInfoWindow() ListMemData( v.begin(), v.end(), []( auto& v ) { ImGui::Text( "0x%" PRIx64, (*v)->ptr ); - } ); + }, nullptr, m_allocTimeRelativeToZone ? ev.start : -1 ); ImGui::TreePop(); } } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 2cb848fa..3fe83853 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -268,6 +268,7 @@ private: bool m_showCallstackFrameAddress = false; bool m_showUnknownFrames = true; bool m_groupChildrenLocations = false; + bool m_allocTimeRelativeToZone = true; ShortcutAction m_shortcut = ShortcutAction::None; Namespace m_namespace = Namespace::Full;