Send callstack payload without iteration, if possible.

This commit is contained in:
Bartosz Taudul 2018-06-23 02:13:52 +02:00
parent a7ace6ef9e
commit a2c6848433

View File

@ -557,11 +557,18 @@ void Profiler::SendCallstackPayload( uint64_t _ptr )
AppendData( &item, QueueDataSize[(int)QueueType::CallstackPayload] ); AppendData( &item, QueueDataSize[(int)QueueType::CallstackPayload] );
AppendData( &l16, sizeof( l16 ) ); AppendData( &l16, sizeof( l16 ) );
if( sizeof( uintptr_t ) == sizeof( uint64_t ) )
{
AppendData( ptr, sizeof( uint64_t ) * sz );
}
else
{
for( uintptr_t i=0; i<sz; i++ ) for( uintptr_t i=0; i<sz; i++ )
{ {
const auto val = uint64_t( *ptr++ ); const auto val = uint64_t( *ptr++ );
AppendData( &val, sizeof( uint64_t ) ); AppendData( &val, sizeof( uint64_t ) );
} }
}
} }
void Profiler::SendCallstackFrame( uint64_t ptr ) void Profiler::SendCallstackFrame( uint64_t ptr )