mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Implement transport of single string data.
In most cases only one string is sent per message and no pointer tracking is needed. This is only plumbing work, no changes to messages have been made yet.
This commit is contained in:
+17
-1
@@ -2672,7 +2672,7 @@ void Worker::Exec()
|
||||
!m_pendingCustomStrings.empty() || m_data.plots.IsPending() || m_pendingCallstackPtr != 0 ||
|
||||
m_pendingExternalNames != 0 || m_pendingCallstackSubframes != 0 || m_pendingFrameImageData.image != nullptr ||
|
||||
!m_pendingSymbols.empty() || !m_pendingSymbolCode.empty() || m_pendingCodeInformation != 0 ||
|
||||
!m_serverQueryQueue.empty() || m_pendingSourceLocationPayload != 0 )
|
||||
!m_serverQueryQueue.empty() || m_pendingSourceLocationPayload != 0 || m_pendingSingleString.ptr != nullptr )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -2941,6 +2941,16 @@ bool Worker::DispatchProcess( const QueueItem& ev, const char*& ptr )
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if( ev.hdr.type == QueueType::SingleStringData )
|
||||
{
|
||||
ptr += sizeof( QueueHeader );
|
||||
uint16_t sz;
|
||||
memcpy( &sz, ptr, sizeof( sz ) );
|
||||
ptr += sizeof( sz );
|
||||
AddSingleString( ptr, sz );
|
||||
ptr += sz;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr += QueueDataSize[ev.hdr.idx];
|
||||
@@ -3350,6 +3360,12 @@ void Worker::AddCustomString( uint64_t ptr, const char* str, size_t sz )
|
||||
m_pendingCustomStrings.emplace( ptr, StoreString( str, sz ) );
|
||||
}
|
||||
|
||||
void Worker::AddSingleString( const char* str, size_t sz )
|
||||
{
|
||||
assert( m_pendingSingleString.ptr == nullptr );
|
||||
m_pendingSingleString = StoreString( str, sz );
|
||||
}
|
||||
|
||||
void Worker::AddExternalName( uint64_t ptr, const char* str, size_t sz )
|
||||
{
|
||||
assert( m_pendingExternalNames > 0 );
|
||||
|
||||
Reference in New Issue
Block a user