1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Don't send unused data.

This commit is contained in:
Bartosz Taudul
2017-09-12 01:14:04 +02:00
parent 25d7cebd8a
commit 3df4cf8acd
2 changed files with 18 additions and 2 deletions
+9 -1
View File
@@ -99,7 +99,15 @@ void Profiler::Worker()
const auto sz = m_queue.try_dequeue_bulk( token, item, BulkSize );
if( sz > 0 )
{
if( sock->Send( item, sz * sizeof( QueueItem ) ) == -1 ) break;
char buf[TargetFrameSize];
char* ptr = buf;
for( int i=0; i<sz; i++ )
{
const auto dsz = QueueDataSize[(uint8_t)item[i].hdr.type];
memcpy( ptr, item+i, dsz );
ptr += dsz;
}
if( sock->Send( buf, ptr - buf ) == -1 ) break;
}
else
{