mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Implement ZoneText() string merging.
This commit is contained in:
parent
30dbf48fda
commit
e8db86d092
@ -3778,7 +3778,22 @@ void Worker::ProcessZoneText( const QueueZoneText& ev )
|
|||||||
auto zone = stack.back();
|
auto zone = stack.back();
|
||||||
auto it = m_pendingCustomStrings.find( ev.text );
|
auto it = m_pendingCustomStrings.find( ev.text );
|
||||||
assert( it != m_pendingCustomStrings.end() );
|
assert( it != m_pendingCustomStrings.end() );
|
||||||
|
if( !zone->text.Active() )
|
||||||
|
{
|
||||||
zone->text = StringIdx( it->second.idx );
|
zone->text = StringIdx( it->second.idx );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const auto str0 = GetString( zone->text );
|
||||||
|
const auto str1 = it->second.ptr;
|
||||||
|
const auto len0 = strlen( str0 );
|
||||||
|
const auto len1 = strlen( str1 );
|
||||||
|
char* buf = (char*)alloca( len0+len1+1 );
|
||||||
|
memcpy( buf, str0, len0 );
|
||||||
|
buf[len0] = '\n';
|
||||||
|
memcpy( buf+len0+1, str1, len1 );
|
||||||
|
zone->text = StringIdx( StoreString( buf, len0+len1+1 ).idx );
|
||||||
|
}
|
||||||
m_pendingCustomStrings.erase( it );
|
m_pendingCustomStrings.erase( it );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user