From 2456ae36bf07bded98664697ca10297405836a10 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 22 Mar 2023 21:55:02 +0100 Subject: [PATCH] Store wait stack in 4 bytes. --- server/TracyTimelineDraw.hpp | 2 +- server/TracyTimelineItemThread.cpp | 4 ++-- server/TracyView_ContextSwitch.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/TracyTimelineDraw.hpp b/server/TracyTimelineDraw.hpp index 3c045843..5c9263a9 100644 --- a/server/TracyTimelineDraw.hpp +++ b/server/TracyTimelineDraw.hpp @@ -44,7 +44,7 @@ struct ContextSwitchDrawFolded struct ContextSwitchDrawWaiting { short_ptr prev; - Int24 waitStack; + uint32_t waitStack; }; struct ContextSwitchDraw diff --git a/server/TracyTimelineItemThread.cpp b/server/TracyTimelineItemThread.cpp index e9bdc93b..8f2e5638 100644 --- a/server/TracyTimelineItemThread.cpp +++ b/server/TracyTimelineItemThread.cpp @@ -472,7 +472,7 @@ void TimelineItemThread::PreprocessContextSwitches( const TimelineContext& ctx, auto& ev = *it; if( pit != citend ) { - Int24 waitStack; + uint32_t waitStack = 0; if( !sampleData.empty() ) { auto sdit = std::lower_bound( sampleData.begin(), sampleData.end(), ev.Start(), [] ( const auto& l, const auto& r ) { return l.time.Val() < r; } ); @@ -484,7 +484,7 @@ void TimelineItemThread::PreprocessContextSwitches( const TimelineContext& ctx, sdit = std::lower_bound( sampleData.begin(), sampleData.end(), eit->End(), [] ( const auto& l, const auto& r ) { return l.time.Val() < r; } ); found = sdit != sampleData.end() && sdit->time.Val() == eit->End(); } - if( found ) waitStack = sdit->callstack; + if( found ) waitStack = sdit->callstack.Val(); } auto& ref = m_ctxDraw.emplace_back( ContextSwitchDraw { ContextSwitchDrawType::Waiting, &ev, float( minpx ) } ); diff --git a/server/TracyView_ContextSwitch.cpp b/server/TracyView_ContextSwitch.cpp index 6477aa60..9a4c5733 100644 --- a/server/TracyView_ContextSwitch.cpp +++ b/server/TracyView_ContextSwitch.cpp @@ -237,7 +237,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector< } if( tooltip ) { - const auto waitStack = v.waiting.waitStack.Val(); + const auto waitStack = v.waiting.waitStack; if( waitStack ) { ImGui::Separator();