Save source location data counts.

This commit is contained in:
Bartosz Taudul 2022-01-29 15:14:43 +01:00
parent 2ca4b0058a
commit 6d55f79109
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 47 additions and 1 deletions

View File

@ -7,7 +7,7 @@ namespace Version
{
enum { Major = 0 };
enum { Minor = 7 };
enum { Patch = 14 };
enum { Patch = 15 };
}
}

View File

@ -781,6 +781,20 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
assert( status.second );
status.first->second.zones.reserve( cnt );
}
if( fileVer >= FileVersion( 0, 7, 15 ) )
{
f.Read( sz );
for( uint64_t i=0; i<sz; i++ )
{
int16_t id;
uint64_t cnt;
f.Read2( id, cnt );
auto status = m_data.gpuSourceLocationZones.emplace( id, GpuSourceLocationZones() );
assert( status.second );
status.first->second.zones.reserve( cnt );
}
}
#else
f.Read( sz );
for( uint64_t i=0; i<sz; i++ )
@ -790,6 +804,18 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
f.Skip( sizeof( uint64_t ) );
m_data.sourceLocationZonesCnt.emplace( id, 0 );
}
if( fileVer >= FileVersion( 0, 7, 15 ) )
{
f.Read( sz );
for( uint64_t i=0; i<sz; i++ )
{
int16_t id;
f.Read( id );
f.Skip( sizeof( uint64_t ) );
m_data.gpuSourceLocationZonesCnt.emplace( id, 0 );
}
}
#endif
s_loadProgress.progress.store( LoadProgress::Locks, std::memory_order_relaxed );
@ -8058,6 +8084,16 @@ void Worker::Write( FileWrite& f, bool fiDict )
f.Write( &id, sizeof( id ) );
f.Write( &cnt, sizeof( cnt ) );
}
sz = m_data.gpuSourceLocationZones.size();
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.gpuSourceLocationZones )
{
int16_t id = v.first;
uint64_t cnt = v.second.zones.size();
f.Write( &id, sizeof( id ) );
f.Write( &cnt, sizeof( cnt ) );
}
#else
sz = m_data.sourceLocationZonesCnt.size();
f.Write( &sz, sizeof( sz ) );
@ -8068,6 +8104,16 @@ void Worker::Write( FileWrite& f, bool fiDict )
f.Write( &id, sizeof( id ) );
f.Write( &cnt, sizeof( cnt ) );
}
sz = m_data.gpuSourceLocationZonesCnt.size();
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.gpuSourceLocationZonesCnt )
{
int16_t id = v.first;
uint64_t cnt = v.second;
f.Write( &id, sizeof( id ) );
f.Write( &cnt, sizeof( cnt ) );
}
#endif
sz = m_data.lockMap.size();