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/HttpSkipResponseCommand.h | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/HttpSkipResponseCommand.h') diff --git a/src/HttpSkipResponseCommand.h b/src/HttpSkipResponseCommand.h index 6d13ef76..dff34f43 100644 --- a/src/HttpSkipResponseCommand.h +++ b/src/HttpSkipResponseCommand.h @@ -45,11 +45,7 @@ class StreamFilter; class HttpSkipResponseCommand : public AbstractCommand { private: - std::shared_ptr httpConnection_; - - std::unique_ptr httpResponse_; - - std::unique_ptr streamFilter_; + // hole from AbstractCommand (5 bytes on x86_64) bool sinkFilterOnly_; @@ -57,21 +53,27 @@ private: int64_t receivedBytes_; + std::shared_ptr httpConnection_; + + std::unique_ptr httpResponse_; + + std::unique_ptr streamFilter_; + bool processResponse(); void poolConnection() const; + protected: virtual bool executeInternal() CXX11_OVERRIDE; + public: - HttpSkipResponseCommand - (cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - const std::shared_ptr& httpConnection, - std::unique_ptr httpResponse, - DownloadEngine* e, - const std::shared_ptr& s); + HttpSkipResponseCommand(cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, + RequestGroup* requestGroup, + const std::shared_ptr& httpConnection, + std::unique_ptr httpResponse, + DownloadEngine* e, + const std::shared_ptr& s); virtual ~HttpSkipResponseCommand(); -- cgit