mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Allow changing lz4 size type.
This commit is contained in:
parent
16dd561029
commit
efd66bb609
@ -120,10 +120,10 @@ void Profiler::Worker()
|
||||
#ifdef _DEBUG
|
||||
if( sock->Send( buf, ptr - buf ) == -1 ) break;
|
||||
#else
|
||||
char lz4[LZ4Size + sizeof( uint16_t )];
|
||||
const uint16_t lz4sz = LZ4_compress_default( buf, lz4+2, ptr - buf, LZ4Size );
|
||||
memcpy( lz4, &lz4sz, sizeof( uint16_t ) );
|
||||
if( sock->Send( lz4, lz4sz ) == -1 ) break;
|
||||
char lz4[LZ4Size + sizeof( lz4sz_t )];
|
||||
const lz4sz_t lz4sz = LZ4_compress_default( buf, lz4 + sizeof( lz4sz_t ), ptr - buf, LZ4Size );
|
||||
memcpy( lz4, &lz4sz, sizeof( lz4sz ) );
|
||||
if( sock->Send( lz4, lz4sz + sizeof( lz4sz_t ) ) == -1 ) break;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -9,9 +9,11 @@
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
using lz4sz_t = uint16_t;
|
||||
|
||||
enum { TargetFrameSize = 64000 };
|
||||
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
|
||||
static_assert( LZ4Size <= std::numeric_limits<uint16_t>::max(), "LZ4Size greater than uint16_t" );
|
||||
static_assert( LZ4Size <= std::numeric_limits<lz4sz_t>::max(), "LZ4Size greater than lz4sz_t" );
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user