Commit e5b4d8b8 authored by Richard Fillman's avatar Richard Fillman Committed by Facebook Github Bot

Move small fields to avoid padding in AsyncSocket.h and AsyncSSLSocket.h

Summary: Compiled mcrouter with the 'Wpadded' flag to try to find any wasted space. Mcrouter itself did not have anything, but there was a lot in AsyncSocket.h and AsyncSSLSocket.h so looked into those and removed a bit of wasted space

Reviewed By: yfeldblum, brianwatling

Differential Revision: D6033977

fbshipit-source-id: 2dc127208e09980be6a5db576b45d30ac6e044ff
parent fe34da59
......@@ -877,8 +877,6 @@ class AsyncSSLSocket : public virtual AsyncSocket {
SSL_SESSION *sslSession_{nullptr};
Timeout handshakeTimeout_;
Timeout connectionTimeout_;
// whether the SSL session was resumed using session ID or not
bool sessionIDResumed_{false};
// The app byte num that we are tracking for the MSG_EOR
// Only one app EOR byte can be tracked.
......@@ -918,10 +916,13 @@ class AsyncSSLSocket : public virtual AsyncSocket {
std::chrono::steady_clock::time_point handshakeStartTime_;
std::chrono::steady_clock::time_point handshakeEndTime_;
std::chrono::milliseconds handshakeConnectTimeout_{0};
bool sessionResumptionAttempted_{false};
std::chrono::milliseconds totalConnectTimeout_{0};
std::string sslVerificationAlert_;
bool sessionResumptionAttempted_{false};
// whether the SSL session was resumed using session ID or not
bool sessionIDResumed_{false};
};
} // namespace
......@@ -1183,6 +1183,11 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
///< The address we are connecting from
uint32_t sendTimeout_; ///< The send timeout, in milliseconds
uint16_t maxReadsPerEvent_; ///< Max reads per event loop iteration
bool isBufferMovable_{false};
int8_t readErr_{READ_NO_ERROR}; ///< The read error encountered, if any
EventBase* eventBase_; ///< The EventBase
WriteTimeout writeTimeout_; ///< A timeout for connect and write
IoHandler ioHandler_; ///< A EventHandler to monitor the fd
......@@ -1198,19 +1203,18 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
std::weak_ptr<ShutdownSocketSet> wShutdownSocketSet_;
size_t appBytesReceived_; ///< Num of bytes received from socket
size_t appBytesWritten_; ///< Num of bytes written to socket
bool isBufferMovable_{false};
// Pre-received data, to be returned to read callback before any data from the
// socket.
std::unique_ptr<IOBuf> preReceivedData_;
int8_t readErr_{READ_NO_ERROR}; ///< The read error encountered, if any
std::chrono::steady_clock::time_point connectStartTime_;
std::chrono::steady_clock::time_point connectEndTime_;
std::chrono::milliseconds connectTimeout_{0};
std::unique_ptr<EvbChangeCallback> evbChangeCb_{nullptr};
BufferCallback* bufferCallback_{nullptr};
bool tfoEnabled_{false};
bool tfoAttempted_{false};
......@@ -1222,8 +1226,6 @@ class AsyncSocket : virtual public AsyncTransportWrapper {
bool zeroCopyEnabled_{false};
bool zeroCopyVal_{false};
size_t zeroCopyWriteChainThreshold_{kDefaultZeroCopyThreshold};
std::unique_ptr<EvbChangeCallback> evbChangeCb_{nullptr};
};
#ifdef _MSC_VER
#pragma vtordisp(pop)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment