From 2db0c81fc8067d73230fcbffc90bd7ad1f9c07b0 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Tue, 26 Nov 2013 02:59:51 +0100 Subject: Stuff memory holes Padding changes on x86_64: - RequestGroup: 29 -> 5 bytes - DownloadContext: 25 -> 1 bytes - Cookie: 20 -> 4 bytes - Command: 8 -> 0 bytes (affects many derived as well) - HttpRequest: 20 -> 4 bytes - DownloadCommand: 18 -> 2 bytes - TimeBasedCommand: 14 -> 6 bytes - AbstractCommand: 13 -> 5 bytes - HttpSkipResponseCommand: 12 -> 4 bytes - FileEntry: 10 -> 2 bytes - DownloadResult: 15 -> 7 bytes - UriStruct: 12 -> 4 bytes - Piece: 11 -> 3 bytes - BitfieldMan -> 11 -> 3 bytes --- src/AbstractCommand.h | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/AbstractCommand.h') diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h index 23fb4950..7f6c9429 100644 --- a/src/AbstractCommand.h +++ b/src/AbstractCommand.h @@ -64,31 +64,34 @@ class AsyncNameResolverMan; class AbstractCommand : public Command { private: - Timer checkPoint_; - time_t timeout_; - - RequestGroup* requestGroup_; std::shared_ptr req_; std::shared_ptr fileEntry_; - DownloadEngine* e_; std::shared_ptr socket_; std::shared_ptr socketRecvBuffer_; - std::vector > segments_; + std::shared_ptr readCheckTarget_; + std::shared_ptr writeCheckTarget_; #ifdef ENABLE_ASYNC_DNS std::unique_ptr asyncNameResolverMan_; #endif // ENABLE_ASYNC_DNS + RequestGroup* requestGroup_; + DownloadEngine* e_; + + std::vector > segments_; + + Timer checkPoint_; + Timer serverStatTimer_; + time_t timeout_; + bool checkSocketIsReadable_; bool checkSocketIsWritable_; - std::shared_ptr readCheckTarget_; - std::shared_ptr writeCheckTarget_; bool incNumConnection_; - Timer serverStatTimer_; int32_t calculateMinSplitSize() const; void useFasterRequest(const std::shared_ptr& fasterRequest); + public: RequestGroup* getRequestGroup() const { @@ -234,13 +237,12 @@ protected: } public: - AbstractCommand - (cuid_t cuid, const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, DownloadEngine* e, - const std::shared_ptr& s = nullptr, - const std::shared_ptr& socketRecvBuffer = nullptr, - bool incNumConnection = true); + AbstractCommand(cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, + RequestGroup* requestGroup, DownloadEngine* e, + const std::shared_ptr& s = nullptr, + const std::shared_ptr& socketRecvBuffer = nullptr, + bool incNumConnection = true); virtual ~AbstractCommand(); virtual bool execute() CXX11_OVERRIDE; -- cgit