mirror of
https://github.com/aria2/aria2.git
synced 2025-01-01 07:36:24 +00:00
Moved bool members to the last to reduce structure size
This commit is contained in:
parent
8b0c701266
commit
71620854c7
@ -46,6 +46,10 @@ namespace aria2 {
|
|||||||
|
|
||||||
PeerSessionResource::PeerSessionResource(int32_t pieceLength, int64_t totalLength)
|
PeerSessionResource::PeerSessionResource(int32_t pieceLength, int64_t totalLength)
|
||||||
:
|
:
|
||||||
|
bitfieldMan_(new BitfieldMan(pieceLength, totalLength)),
|
||||||
|
lastDownloadUpdate_(0),
|
||||||
|
lastAmUnchoking_(0),
|
||||||
|
dispatcher_(0),
|
||||||
amChoking_(true),
|
amChoking_(true),
|
||||||
amInterested_(false),
|
amInterested_(false),
|
||||||
peerChoking_(true),
|
peerChoking_(true),
|
||||||
@ -53,13 +57,9 @@ PeerSessionResource::PeerSessionResource(int32_t pieceLength, int64_t totalLengt
|
|||||||
chokingRequired_(true),
|
chokingRequired_(true),
|
||||||
optUnchoking_(false),
|
optUnchoking_(false),
|
||||||
snubbing_(false),
|
snubbing_(false),
|
||||||
bitfieldMan_(new BitfieldMan(pieceLength, totalLength)),
|
|
||||||
fastExtensionEnabled_(false),
|
fastExtensionEnabled_(false),
|
||||||
extendedMessagingEnabled_(false),
|
extendedMessagingEnabled_(false),
|
||||||
dhtEnabled_(false),
|
dhtEnabled_(false)
|
||||||
lastDownloadUpdate_(0),
|
|
||||||
lastAmUnchoking_(0),
|
|
||||||
dispatcher_(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
PeerSessionResource::~PeerSessionResource()
|
PeerSessionResource::~PeerSessionResource()
|
||||||
|
@ -52,6 +52,20 @@ class BtMessageDispatcher;
|
|||||||
|
|
||||||
class PeerSessionResource {
|
class PeerSessionResource {
|
||||||
private:
|
private:
|
||||||
|
BitfieldMan* bitfieldMan_;
|
||||||
|
// fast index set which a peer has sent to localhost.
|
||||||
|
std::set<size_t> peerAllowedIndexSet_;
|
||||||
|
// fast index set which localhost has sent to a peer.
|
||||||
|
std::set<size_t> amAllowedIndexSet_;
|
||||||
|
ExtensionMessageRegistry extreg_;
|
||||||
|
PeerStat peerStat_;
|
||||||
|
|
||||||
|
Timer lastDownloadUpdate_;
|
||||||
|
|
||||||
|
Timer lastAmUnchoking_;
|
||||||
|
|
||||||
|
BtMessageDispatcher* dispatcher_;
|
||||||
|
|
||||||
// localhost is choking this peer
|
// localhost is choking this peer
|
||||||
bool amChoking_;
|
bool amChoking_;
|
||||||
// localhost is interested in this peer
|
// localhost is interested in this peer
|
||||||
@ -66,23 +80,9 @@ private:
|
|||||||
bool optUnchoking_;
|
bool optUnchoking_;
|
||||||
// this peer is snubbing.
|
// this peer is snubbing.
|
||||||
bool snubbing_;
|
bool snubbing_;
|
||||||
|
|
||||||
BitfieldMan* bitfieldMan_;
|
|
||||||
bool fastExtensionEnabled_;
|
bool fastExtensionEnabled_;
|
||||||
// fast index set which a peer has sent to localhost.
|
|
||||||
std::set<size_t> peerAllowedIndexSet_;
|
|
||||||
// fast index set which localhost has sent to a peer.
|
|
||||||
std::set<size_t> amAllowedIndexSet_;
|
|
||||||
bool extendedMessagingEnabled_;
|
bool extendedMessagingEnabled_;
|
||||||
ExtensionMessageRegistry extreg_;
|
|
||||||
bool dhtEnabled_;
|
bool dhtEnabled_;
|
||||||
PeerStat peerStat_;
|
|
||||||
|
|
||||||
Timer lastDownloadUpdate_;
|
|
||||||
|
|
||||||
Timer lastAmUnchoking_;
|
|
||||||
|
|
||||||
BtMessageDispatcher* dispatcher_;
|
|
||||||
public:
|
public:
|
||||||
PeerSessionResource(int32_t pieceLength, int64_t totalLength);
|
PeerSessionResource(int32_t pieceLength, int64_t totalLength);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user