mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Manual ZoneEvent vector initialization.
This commit is contained in:
parent
13d8d9255e
commit
afa9eec5dd
@ -66,6 +66,8 @@ enum { SourceLocationSize = sizeof( SourceLocation ) };
|
||||
|
||||
struct ZoneEvent
|
||||
{
|
||||
void Init() { memset( &child, 0, 12 ); }
|
||||
|
||||
int64_t start;
|
||||
int64_t end;
|
||||
int32_t srcloc;
|
||||
@ -77,6 +79,7 @@ struct ZoneEvent
|
||||
};
|
||||
|
||||
enum { ZoneEventSize = sizeof( ZoneEvent ) };
|
||||
static_assert( sizeof( ZoneEvent::child ) == 13, "Adjust vector clear size!" );
|
||||
|
||||
|
||||
struct LockEvent
|
||||
|
@ -174,6 +174,7 @@ private:
|
||||
{
|
||||
memUsage.fetch_add( sizeof( T ), std::memory_order_relaxed );
|
||||
m_ptr = new T[1];
|
||||
m_capacity = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -615,7 +615,8 @@ void View::Process( const QueueItem& ev )
|
||||
|
||||
void View::ProcessZoneBegin( const QueueZoneBegin& ev )
|
||||
{
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
auto zone = m_slab.Alloc<ZoneEvent>();
|
||||
zone->Init();
|
||||
|
||||
CheckSourceLocation( ev.srcloc );
|
||||
|
||||
@ -636,7 +637,8 @@ void View::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
|
||||
auto it = m_pendingSourceLocationPayload.find( ev.srcloc );
|
||||
assert( it != m_pendingSourceLocationPayload.end() );
|
||||
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
auto zone = m_slab.Alloc<ZoneEvent>();
|
||||
zone->Init();
|
||||
|
||||
zone->start = ev.time * m_timerMul;
|
||||
zone->end = -1;
|
||||
@ -3845,7 +3847,9 @@ void View::ReadTimeline( FileRead& f, Vector<ZoneEvent*>& vec )
|
||||
|
||||
for( uint64_t i=0; i<sz; i++ )
|
||||
{
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
auto zone = m_slab.Alloc<ZoneEvent>();
|
||||
zone->Init();
|
||||
|
||||
m_zonesCnt++;
|
||||
vec.push_back( zone );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user