mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Return zone extra during allocation.
This commit is contained in:
parent
4bf0af321f
commit
ecc9369da2
@ -5287,8 +5287,7 @@ void Worker::ReadTimelinePre063( FileRead& f, Vector<short_ptr<ZoneEvent>>& _vec
|
|||||||
zone->extra = 0;
|
zone->extra = 0;
|
||||||
if( extra.callstack.Val() != 0 || extra.name.Active() || extra.text.Active() )
|
if( extra.callstack.Val() != 0 || extra.name.Active() || extra.text.Active() )
|
||||||
{
|
{
|
||||||
AllocZoneExtra( *zone );
|
memcpy( &AllocZoneExtra( *zone ), &extra, sizeof( ZoneExtra ) );
|
||||||
memcpy( &GetZoneExtraMutable( *zone ), &extra, sizeof( ZoneExtra ) );
|
|
||||||
}
|
}
|
||||||
refTime += zone->_end_child1;
|
refTime += zone->_end_child1;
|
||||||
zone->SetStart( refTime - m_data.baseTime );
|
zone->SetStart( refTime - m_data.baseTime );
|
||||||
@ -5979,18 +5978,25 @@ const Worker::CpuThreadTopology* Worker::GetThreadTopology( uint32_t cpuThread )
|
|||||||
return &it->second;
|
return &it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Worker::AllocZoneExtra( ZoneEvent& ev )
|
ZoneExtra& Worker::AllocZoneExtra( ZoneEvent& ev )
|
||||||
{
|
{
|
||||||
assert( ev.extra == 0 );
|
assert( ev.extra == 0 );
|
||||||
ev.extra = uint32_t( m_data.zoneExtra.size() );
|
ev.extra = uint32_t( m_data.zoneExtra.size() );
|
||||||
auto& extra = m_data.zoneExtra.push_next();
|
auto& extra = m_data.zoneExtra.push_next();
|
||||||
memset( &extra, 0, sizeof( extra ) );
|
memset( &extra, 0, sizeof( extra ) );
|
||||||
|
return extra;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoneExtra& Worker::RequestZoneExtra( ZoneEvent& ev )
|
ZoneExtra& Worker::RequestZoneExtra( ZoneEvent& ev )
|
||||||
{
|
{
|
||||||
if( !HasZoneExtra( ev ) ) AllocZoneExtra( ev );
|
if( !HasZoneExtra( ev ) )
|
||||||
|
{
|
||||||
|
return AllocZoneExtra( ev );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return GetZoneExtraMutable( ev );
|
return GetZoneExtraMutable( ev );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -630,7 +630,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
tracy_force_inline ZoneExtra& GetZoneExtraMutable( const ZoneEvent& ev ) { return m_data.zoneExtra[ev.extra]; }
|
tracy_force_inline ZoneExtra& GetZoneExtraMutable( const ZoneEvent& ev ) { return m_data.zoneExtra[ev.extra]; }
|
||||||
tracy_force_inline void AllocZoneExtra( ZoneEvent& ev );
|
tracy_force_inline ZoneExtra& AllocZoneExtra( ZoneEvent& ev );
|
||||||
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
||||||
|
|
||||||
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
||||||
|
Loading…
Reference in New Issue
Block a user