From 1585be7ff3f5fdf289b41920a1813f861b1bfd52 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 29 Jan 2019 21:56:10 +0100 Subject: [PATCH] Rearrange Socket to reduce struct size. --- common/TracySocket.cpp | 8 ++++---- common/TracySocket.hpp | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 7cd07b67..fe19fd17 100644 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -56,9 +56,9 @@ void InitWinSock() #endif Socket::Socket() - : m_sock( -1 ) - , m_buf( (char*)tracy_malloc( BufSize ) ) + : m_buf( (char*)tracy_malloc( BufSize ) ) , m_bufPtr( nullptr ) + , m_sock( -1 ) , m_bufLeft( 0 ) { #ifdef _WIN32 @@ -67,9 +67,9 @@ Socket::Socket() } Socket::Socket( int sock ) - : m_sock( sock ) - , m_buf( (char*)tracy_malloc( BufSize ) ) + : m_buf( (char*)tracy_malloc( BufSize ) ) , m_bufPtr( nullptr ) + , m_sock( sock ) , m_bufLeft( 0 ) { } diff --git a/common/TracySocket.hpp b/common/TracySocket.hpp index 3a5aaafe..ff05b520 100644 --- a/common/TracySocket.hpp +++ b/common/TracySocket.hpp @@ -39,10 +39,9 @@ private: int RecvBuffered( void* buf, int len, const timeval* tv ); int Recv( void* buf, int len, const timeval* tv ); - int m_sock; - char* m_buf; char* m_bufPtr; + int m_sock; int m_bufLeft; };