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:
@@ -2244,6 +2244,21 @@ void Profiler::SendString( uint64_t str, const char* ptr, size_t len, QueueType
|
||||
AppendDataUnsafe( ptr, l16 );
|
||||
}
|
||||
|
||||
void Profiler::SendSingleString( const char* ptr, size_t len )
|
||||
{
|
||||
QueueItem item;
|
||||
MemWrite( &item.hdr.type, QueueType::SingleStringData );
|
||||
|
||||
assert( len <= std::numeric_limits<uint16_t>::max() );
|
||||
auto l16 = uint16_t( len );
|
||||
|
||||
NeedDataSize( QueueDataSize[(int)QueueType::SingleStringData] + sizeof( l16 ) + l16 );
|
||||
|
||||
AppendDataUnsafe( &item, QueueDataSize[(int)QueueType::SingleStringData] );
|
||||
AppendDataUnsafe( &l16, sizeof( l16 ) );
|
||||
AppendDataUnsafe( ptr, l16 );
|
||||
}
|
||||
|
||||
void Profiler::SendLongString( uint64_t str, const char* ptr, size_t len, QueueType type )
|
||||
{
|
||||
assert( type == QueueType::FrameImageData ||
|
||||
|
||||
Reference in New Issue
Block a user