mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Wrapper for allocation and retrieval of zone extra.
This commit is contained in:
parent
217c16de20
commit
4bf0af321f
@ -3822,8 +3822,7 @@ void Worker::ProcessZoneText( const QueueZoneText& ev )
|
||||
auto zone = stack.back();
|
||||
auto it = m_pendingCustomStrings.find( ev.text );
|
||||
assert( it != m_pendingCustomStrings.end() );
|
||||
if( !HasZoneExtra( *zone ) ) AllocZoneExtra( *zone );
|
||||
auto& extra = GetZoneExtraMutable( *zone );
|
||||
auto& extra = RequestZoneExtra( *zone );
|
||||
if( !extra.text.Active() )
|
||||
{
|
||||
extra.text = StringIdx( it->second.idx );
|
||||
@ -3857,8 +3856,7 @@ void Worker::ProcessZoneName( const QueueZoneText& ev )
|
||||
auto zone = stack.back();
|
||||
auto it = m_pendingCustomStrings.find( ev.text );
|
||||
assert( it != m_pendingCustomStrings.end() );
|
||||
if( !HasZoneExtra( *zone ) ) AllocZoneExtra( *zone );
|
||||
auto& extra = GetZoneExtraMutable( *zone );
|
||||
auto& extra = RequestZoneExtra( *zone );
|
||||
extra.name = StringIdx( it->second.idx );
|
||||
m_pendingCustomStrings.erase( it );
|
||||
}
|
||||
@ -4513,8 +4511,7 @@ void Worker::ProcessCallstack( const QueueCallstack& ev )
|
||||
{
|
||||
case NextCallstackType::Zone:
|
||||
{
|
||||
if( !HasZoneExtra( *next.zone ) ) AllocZoneExtra( *next.zone );
|
||||
auto& extra = GetZoneExtraMutable( *next.zone );
|
||||
auto& extra = RequestZoneExtra( *next.zone );
|
||||
extra.callstack.SetVal( m_pendingCallstackId );
|
||||
break;
|
||||
}
|
||||
@ -4551,8 +4548,7 @@ void Worker::ProcessCallstackAlloc( const QueueCallstackAlloc& ev )
|
||||
{
|
||||
case NextCallstackType::Zone:
|
||||
{
|
||||
if( !HasZoneExtra( *next.zone ) ) AllocZoneExtra( *next.zone );
|
||||
auto& extra = GetZoneExtraMutable( *next.zone );
|
||||
auto& extra = RequestZoneExtra( *next.zone );
|
||||
extra.callstack.SetVal( m_pendingCallstackId );
|
||||
break;
|
||||
}
|
||||
@ -5991,4 +5987,10 @@ void Worker::AllocZoneExtra( ZoneEvent& ev )
|
||||
memset( &extra, 0, sizeof( extra ) );
|
||||
}
|
||||
|
||||
ZoneExtra& Worker::RequestZoneExtra( ZoneEvent& ev )
|
||||
{
|
||||
if( !HasZoneExtra( ev ) ) AllocZoneExtra( ev );
|
||||
return GetZoneExtraMutable( ev );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -631,6 +631,7 @@ private:
|
||||
|
||||
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& RequestZoneExtra( ZoneEvent& ev );
|
||||
|
||||
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
||||
void ReadTimelinePre063( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint64_t size, int64_t& refTime, int32_t& childIdx, int fileVer );
|
||||
|
Loading…
x
Reference in New Issue
Block a user