Init common Worker variables in header.

This commit is contained in:
Bartosz Taudul 2019-01-06 19:04:50 +01:00
parent a313ed4720
commit 5ac26ce084
2 changed files with 6 additions and 16 deletions

View File

@ -209,11 +209,7 @@ LoadProgress Worker::s_loadProgress;
Worker::Worker( const char* addr )
: m_addr( addr )
, m_connected( false )
, m_hasData( false )
, m_shutdown( false )
, m_terminate( false )
, m_crashed( false )
, m_stream( LZ4_createStreamDecode() )
, m_buffer( new char[TargetFrameSize*3 + 1] )
, m_bufferOffset( 0 )
@ -222,7 +218,6 @@ Worker::Worker( const char* addr )
, m_pendingSourceLocation( 0 )
, m_pendingCallstackFrames( 0 )
, m_traceVersion( CurrentVersion )
, m_handshake( 0 )
{
m_data.sourceLocationExpand.push_back( 0 );
m_data.threadExpand.push_back( 0 );
@ -239,14 +234,9 @@ Worker::Worker( const char* addr )
}
Worker::Worker( FileRead& f, EventType::Type eventMask )
: m_connected( false )
, m_hasData( true )
, m_shutdown( false )
, m_terminate( false )
, m_crashed( false )
: m_hasData( true )
, m_stream( nullptr )
, m_buffer( nullptr )
, m_handshake( 0 )
{
m_data.threadExpand.push_back( 0 );
m_data.callstackPayload.push_back( nullptr );

View File

@ -374,9 +374,9 @@ private:
std::string m_addr;
std::thread m_thread;
std::atomic<bool> m_connected;
std::atomic<bool> m_connected = false;
std::atomic<bool> m_hasData;
std::atomic<bool> m_shutdown;
std::atomic<bool> m_shutdown = false;
std::thread m_threadMemory, m_threadZones;
@ -387,8 +387,8 @@ private:
std::string m_captureProgram;
uint64_t m_captureTime;
std::string m_hostInfo;
bool m_terminate;
bool m_crashed;
bool m_terminate = false;
bool m_crashed = false;
LZ4_streamDecode_t* m_stream;
char* m_buffer;
int m_bufferOffset;
@ -417,7 +417,7 @@ private:
MbpsBlock m_mbpsData;
int m_traceVersion;
std::atomic<uint8_t> m_handshake;
std::atomic<uint8_t> m_handshake = 0;
static LoadProgress s_loadProgress;
};