Simplify loading memory events.

This commit is contained in:
Bartosz Taudul 2019-02-16 22:32:14 +01:00
parent 569a9fb9be
commit d030674b83

View File

@ -880,19 +880,10 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
s_loadProgress.subProgress.store( i, std::memory_order_relaxed ); s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
if( fileVer > FileVersion( 0, 4, 1 ) ) if( fileVer > FileVersion( 0, 4, 1 ) )
{ {
f.Read2( mem->ptr, mem->size ); f.Read( mem, sizeof( MemEvent::ptr ) + sizeof( MemEvent::size ) + sizeof( MemEvent::timeAlloc ) + sizeof( MemEvent::timeFree ) + sizeof( MemEvent::csAlloc ) + sizeof( MemEvent::csFree ) );
mem->timeAlloc = ReadTimeOffset( f, refTime ); refTime += mem->timeAlloc;
int64_t freeOffset; mem->timeAlloc = refTime;
f.Read( freeOffset ); if( mem->timeFree >= 0 ) mem->timeFree += refTime;
if( freeOffset < 0 )
{
mem->timeFree = freeOffset;
}
else
{
mem->timeFree = mem->timeAlloc + freeOffset;
}
f.Read2( mem->csAlloc, mem->csFree );
} }
else if( fileVer > FileVersion( 0, 3, 1 ) ) else if( fileVer > FileVersion( 0, 3, 1 ) )
{ {