Unsafe version of AppendData.

This commit is contained in:
Bartosz Taudul 2018-06-23 02:16:58 +02:00
parent a2c6848433
commit 4d197ec7a2
2 changed files with 7 additions and 2 deletions

View File

@ -456,8 +456,7 @@ bool Profiler::AppendData( const void* data, size_t len )
{ {
auto ret = true; auto ret = true;
ret = NeedDataSize( len ); ret = NeedDataSize( len );
memcpy( m_buffer + m_bufferOffset, data, len ); AppendDataUnsafe( data, len );
m_bufferOffset += int( len );
return ret; return ret;
} }

View File

@ -279,6 +279,12 @@ private:
bool CommitData(); bool CommitData();
bool NeedDataSize( size_t len ); bool NeedDataSize( size_t len );
tracy_force_inline void AppendDataUnsafe( const void* data, size_t len )
{
memcpy( m_buffer + m_bufferOffset, data, len );
m_bufferOffset += int( len );
}
bool SendData( const char* data, size_t len ); bool SendData( const char* data, size_t len );
void SendString( uint64_t ptr, const char* str, QueueType type ); void SendString( uint64_t ptr, const char* str, QueueType type );
void SendSourceLocation( uint64_t ptr ); void SendSourceLocation( uint64_t ptr );