Rearrange Socket to reduce struct size.

This commit is contained in:
Bartosz Taudul 2019-01-29 21:56:10 +01:00
parent b7fd0bdc9c
commit 1585be7ff3
2 changed files with 5 additions and 6 deletions

View File

@ -56,9 +56,9 @@ void InitWinSock()
#endif #endif
Socket::Socket() Socket::Socket()
: m_sock( -1 ) : m_buf( (char*)tracy_malloc( BufSize ) )
, m_buf( (char*)tracy_malloc( BufSize ) )
, m_bufPtr( nullptr ) , m_bufPtr( nullptr )
, m_sock( -1 )
, m_bufLeft( 0 ) , m_bufLeft( 0 )
{ {
#ifdef _WIN32 #ifdef _WIN32
@ -67,9 +67,9 @@ Socket::Socket()
} }
Socket::Socket( int sock ) Socket::Socket( int sock )
: m_sock( sock ) : m_buf( (char*)tracy_malloc( BufSize ) )
, m_buf( (char*)tracy_malloc( BufSize ) )
, m_bufPtr( nullptr ) , m_bufPtr( nullptr )
, m_sock( sock )
, m_bufLeft( 0 ) , m_bufLeft( 0 )
{ {
} }

View File

@ -39,10 +39,9 @@ private:
int RecvBuffered( void* buf, int len, const timeval* tv ); int RecvBuffered( void* buf, int len, const timeval* tv );
int Recv( void* buf, int len, const timeval* tv ); int Recv( void* buf, int len, const timeval* tv );
int m_sock;
char* m_buf; char* m_buf;
char* m_bufPtr; char* m_bufPtr;
int m_sock;
int m_bufLeft; int m_bufLeft;
}; };