1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

Move protocol specific sizes to common header.

This commit is contained in:
Bartosz Taudul 2017-09-13 22:56:55 +02:00
parent a31ab6a256
commit 16dd561029
2 changed files with 19 additions and 4 deletions

View File

@ -1,9 +1,9 @@
#include <assert.h>
#include <chrono>
#include <limits>
#include <memory>
#include "../common/tracy_lz4.hpp"
#include "../common/TracyProtocol.hpp"
#include "../common/TracySocket.hpp"
#include "../common/TracySystem.hpp"
#include "TracyProfiler.hpp"
@ -74,10 +74,7 @@ Profiler* Profiler::Instance()
void Profiler::Worker()
{
enum { TargetFrameSize = 64000 };
enum { BulkSize = TargetFrameSize / QueueItemSize };
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
static_assert( LZ4Size <= std::numeric_limits<uint16_t>::max(), "LZ4Size greater than uint16_t" );
moodycamel::ConsumerToken token( m_queue );

18
common/TracyProtocol.hpp Executable file
View File

@ -0,0 +1,18 @@
#ifndef __TRACYPROTOCOL_HPP__
#define __TRACYPROTOCOL_HPP__
#include <limits>
#include <stdint.h>
#include "../common/tracy_lz4.hpp"
namespace tracy
{
enum { TargetFrameSize = 64000 };
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
static_assert( LZ4Size <= std::numeric_limits<uint16_t>::max(), "LZ4Size greater than uint16_t" );
}
#endif