mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Slab allocator is not thread safe.
This commit is contained in:
parent
3fba965c3c
commit
ab2945b988
@ -555,6 +555,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
if( fileVer == 0 && f.IsEOF() ) return;
|
||||
|
||||
f.Read( sz );
|
||||
bool reconstructMemAllocPlot = false;
|
||||
if( eventMask & EventType::Memory )
|
||||
{
|
||||
m_data.memory.data.reserve_and_use( sz );
|
||||
@ -601,7 +602,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
|
||||
if( sz != 0 )
|
||||
{
|
||||
m_threadMemory = std::thread( [this] { ReconstructMemAllocPlot(); } );
|
||||
reconstructMemAllocPlot = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -631,7 +632,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
f.Skip( sizeof( MemData::high ) + sizeof( MemData::low ) + sizeof( MemData::usage ) );
|
||||
}
|
||||
|
||||
if( fileVer <= FileVersion( 0, 3, 1 ) ) return;
|
||||
if( fileVer <= FileVersion( 0, 3, 1 ) ) goto finishLoading;
|
||||
|
||||
f.Read( sz );
|
||||
m_data.callstackPayload.reserve( sz );
|
||||
@ -664,6 +665,12 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
|
||||
m_data.callstackFrameMap.emplace( ptr, frame );
|
||||
}
|
||||
|
||||
finishLoading:
|
||||
if( reconstructMemAllocPlot )
|
||||
{
|
||||
m_threadMemory = std::thread( [this] { ReconstructMemAllocPlot(); } );
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
Loading…
Reference in New Issue
Block a user