From d030674b838b7ae1ea3a638264e64ecfb7d19eac Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 16 Feb 2019 22:32:14 +0100 Subject: [PATCH] Simplify loading memory events. --- server/TracyWorker.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index ac2806bb..57c8c200 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -880,19 +880,10 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) s_loadProgress.subProgress.store( i, std::memory_order_relaxed ); if( fileVer > FileVersion( 0, 4, 1 ) ) { - f.Read2( mem->ptr, mem->size ); - mem->timeAlloc = ReadTimeOffset( f, refTime ); - int64_t freeOffset; - f.Read( freeOffset ); - if( freeOffset < 0 ) - { - mem->timeFree = freeOffset; - } - else - { - mem->timeFree = mem->timeAlloc + freeOffset; - } - f.Read2( mem->csAlloc, mem->csFree ); + f.Read( mem, sizeof( MemEvent::ptr ) + sizeof( MemEvent::size ) + sizeof( MemEvent::timeAlloc ) + sizeof( MemEvent::timeFree ) + sizeof( MemEvent::csAlloc ) + sizeof( MemEvent::csFree ) ); + refTime += mem->timeAlloc; + mem->timeAlloc = refTime; + if( mem->timeFree >= 0 ) mem->timeFree += refTime; } else if( fileVer > FileVersion( 0, 3, 1 ) ) {