From 71620854c73624da775dc190e5f17ef6b556442a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 7 Oct 2012 22:14:06 +0900 Subject: [PATCH] Moved bool members to the last to reduce structure size --- src/PeerSessionResource.cc | 10 +++++----- src/PeerSessionResource.h | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/PeerSessionResource.cc b/src/PeerSessionResource.cc index 2e0f4b88..57d360cb 100644 --- a/src/PeerSessionResource.cc +++ b/src/PeerSessionResource.cc @@ -46,6 +46,10 @@ namespace aria2 { PeerSessionResource::PeerSessionResource(int32_t pieceLength, int64_t totalLength) : + bitfieldMan_(new BitfieldMan(pieceLength, totalLength)), + lastDownloadUpdate_(0), + lastAmUnchoking_(0), + dispatcher_(0), amChoking_(true), amInterested_(false), peerChoking_(true), @@ -53,13 +57,9 @@ PeerSessionResource::PeerSessionResource(int32_t pieceLength, int64_t totalLengt chokingRequired_(true), optUnchoking_(false), snubbing_(false), - bitfieldMan_(new BitfieldMan(pieceLength, totalLength)), fastExtensionEnabled_(false), extendedMessagingEnabled_(false), - dhtEnabled_(false), - lastDownloadUpdate_(0), - lastAmUnchoking_(0), - dispatcher_(0) + dhtEnabled_(false) {} PeerSessionResource::~PeerSessionResource() diff --git a/src/PeerSessionResource.h b/src/PeerSessionResource.h index 84e7f537..e1683d34 100644 --- a/src/PeerSessionResource.h +++ b/src/PeerSessionResource.h @@ -52,6 +52,20 @@ class BtMessageDispatcher; class PeerSessionResource { private: + BitfieldMan* bitfieldMan_; + // fast index set which a peer has sent to localhost. + std::set peerAllowedIndexSet_; + // fast index set which localhost has sent to a peer. + std::set amAllowedIndexSet_; + ExtensionMessageRegistry extreg_; + PeerStat peerStat_; + + Timer lastDownloadUpdate_; + + Timer lastAmUnchoking_; + + BtMessageDispatcher* dispatcher_; + // localhost is choking this peer bool amChoking_; // localhost is interested in this peer @@ -66,23 +80,9 @@ private: bool optUnchoking_; // this peer is snubbing. bool snubbing_; - - BitfieldMan* bitfieldMan_; bool fastExtensionEnabled_; - // fast index set which a peer has sent to localhost. - std::set peerAllowedIndexSet_; - // fast index set which localhost has sent to a peer. - std::set amAllowedIndexSet_; bool extendedMessagingEnabled_; - ExtensionMessageRegistry extreg_; bool dhtEnabled_; - PeerStat peerStat_; - - Timer lastDownloadUpdate_; - - Timer lastAmUnchoking_; - - BtMessageDispatcher* dispatcher_; public: PeerSessionResource(int32_t pieceLength, int64_t totalLength);