From dac6a65156ae9b4e5ffe7a05fbda1a7f0a6973ba Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 2 May 2018 18:41:11 +0200 Subject: [PATCH] Infer total mem usage change from alloc and free changes. --- server/TracyView.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8e3ea3c9..e39da092 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2694,7 +2694,6 @@ void View::DrawZoneInfoWindow() } else { - int64_t change = 0; int64_t cAlloc = 0; int64_t cFree = 0; int64_t nAlloc = 0; @@ -2704,7 +2703,6 @@ void View::DrawZoneInfoWindow() { if( ait->threadAlloc == thread ) { - change += ait->size; cAlloc += ait->size; nAlloc++; } @@ -2714,7 +2712,6 @@ void View::DrawZoneInfoWindow() { if( mem.data[*fit].threadFree == thread ) { - change -= mem.data[*fit].size; cFree += mem.data[*fit].size; nFree++; } @@ -2731,7 +2728,7 @@ void View::DrawZoneInfoWindow() ImGui::Text( "%s allocs, %s frees.", RealToString( nAlloc, true ), RealToString( nFree, true ) ); ImGui::Text( "Memory allocated: %s bytes", RealToString( cAlloc, true ) ); ImGui::Text( "Memory freed: %s bytes", RealToString( cFree, true ) ); - ImGui::Text( "Overall change: %s bytes", RealToString( change, true ) ); + ImGui::Text( "Overall change: %s bytes", RealToString( cAlloc - cFree, true ) ); } } }