mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +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
|
#ifdef _DEBUG
|
||||||
if( sock->Send( buf, ptr - buf ) == -1 ) break;
|
if( sock->Send( buf, ptr - buf ) == -1 ) break;
|
||||||
#else
|
#else
|
||||||
char lz4[LZ4Size + sizeof( uint16_t )];
|
char lz4[LZ4Size + sizeof( lz4sz_t )];
|
||||||
const uint16_t lz4sz = LZ4_compress_default( buf, lz4+2, ptr - buf, LZ4Size );
|
const lz4sz_t lz4sz = LZ4_compress_default( buf, lz4 + sizeof( lz4sz_t ), ptr - buf, LZ4Size );
|
||||||
memcpy( lz4, &lz4sz, sizeof( uint16_t ) );
|
memcpy( lz4, &lz4sz, sizeof( lz4sz ) );
|
||||||
if( sock->Send( lz4, lz4sz ) == -1 ) break;
|
if( sock->Send( lz4, lz4sz + sizeof( lz4sz_t ) ) == -1 ) break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -9,9 +9,11 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
|
using lz4sz_t = uint16_t;
|
||||||
|
|
||||||
enum { TargetFrameSize = 64000 };
|
enum { TargetFrameSize = 64000 };
|
||||||
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
|
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