diff --git a/server/TracyFileRead.hpp b/server/TracyFileRead.hpp index 6c9810c1..0ebcb5d6 100644 --- a/server/TracyFileRead.hpp +++ b/server/TracyFileRead.hpp @@ -42,7 +42,7 @@ public: } } - void Skip( size_t size ) + tracy_force_inline void Skip( size_t size ) { if( size <= BufSize - m_offset ) { @@ -50,23 +50,7 @@ public: } else { - char m_lz4buf[LZ4Size]; - while( size > 0 ) - { - if( m_offset == BufSize ) - { - std::swap( m_buf, m_second ); - m_offset = 0; - uint32_t sz; - fread( &sz, 1, sizeof( sz ), m_file ); - fread( m_lz4buf, 1, sz, m_file ); - m_lastBlock = LZ4_decompress_safe_continue( m_stream, m_lz4buf, m_buf, sz, BufSize ); - } - - const auto sz = std::min( size, BufSize - m_offset ); - m_offset += sz; - size -= sz; - } + SkipBig( size ); } } @@ -132,6 +116,27 @@ private: } } + void SkipBig( size_t size ) + { + char m_lz4buf[LZ4Size]; + while( size > 0 ) + { + if( m_offset == BufSize ) + { + std::swap( m_buf, m_second ); + m_offset = 0; + uint32_t sz; + fread( &sz, 1, sizeof( sz ), m_file ); + fread( m_lz4buf, 1, sz, m_file ); + m_lastBlock = LZ4_decompress_safe_continue( m_stream, m_lz4buf, m_buf, sz, BufSize ); + } + + const auto sz = std::min( size, BufSize - m_offset ); + m_offset += sz; + size -= sz; + } + } + enum { BufSize = 64 * 1024 }; enum { LZ4Size = LZ4_COMPRESSBOUND( BufSize ) };