Save and load hardware sample data.

This commit is contained in:
Bartosz Taudul 2021-05-20 19:37:51 +02:00
parent df50eb890f
commit c6f071a66a
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 22 additions and 1 deletions

View File

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

View File

@ -1699,6 +1699,19 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
}
}
if( fileVer >= FileVersion( 0, 7, 9 ) )
{
f.Read( sz );
m_data.hwSamples.reserve( sz );
for( uint64_t i=0; i<sz; i++ )
{
uint64_t addr;
HwSampleData data;
f.Read2( addr, data );
m_data.hwSamples.emplace( addr, data );
}
}
if( fileVer >= FileVersion( 0, 6, 13 ) )
{
f.Read( sz );
@ -7523,6 +7536,14 @@ void Worker::Write( FileWrite& f, bool fiDict )
}
}
sz = m_data.hwSamples.size();
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.hwSamples )
{
f.Write( &v.first, sizeof( v.first ) );
f.Write( &v.second, sizeof( v.second ) );
}
sz = m_data.sourceFileCache.size();
f.Write( &sz, sizeof( sz ) );
for( auto& v : m_data.sourceFileCache )