Send source location answer in stream, not as separate packet.

This commit is contained in:
Bartosz Taudul 2017-09-26 19:00:25 +02:00
parent e90a86e06e
commit e076d1d475
2 changed files with 3 additions and 12 deletions

View File

@ -216,7 +216,7 @@ bool Profiler::SendString( uint64_t str, const char* ptr, QueueType type )
return SendData( buf, sizeof( hdr ) + sizeof( l16 ) + l16 );
}
bool Profiler::SendSourceLocation( uint64_t ptr )
void Profiler::SendSourceLocation( uint64_t ptr )
{
auto srcloc = (const SourceLocation*)ptr;
QueueItem item;
@ -226,16 +226,7 @@ bool Profiler::SendSourceLocation( uint64_t ptr )
item.srcloc.function = (uint64_t)srcloc->function;
item.srcloc.line = srcloc->line;
item.srcloc.color = srcloc->color;
const auto sz = QueueDataSize[item.hdr.idx];
auto buf = m_buffer + m_bufferOffset;
memcpy( buf, &item, sz );
m_bufferOffset += sz;
if( m_bufferOffset > TargetFrameSize * 2 ) m_bufferOffset = 0;
return SendData( buf, sz );
s_queue.enqueue( GetToken(), std::move( item ) );
}
bool Profiler::HandleServerQuery()

View File

@ -54,7 +54,7 @@ private:
bool SendData( const char* data, size_t len );
bool SendString( uint64_t ptr, const char* str, QueueType type );
bool SendSourceLocation( uint64_t ptr );
void SendSourceLocation( uint64_t ptr );
bool HandleServerQuery();