diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-16 18:56:20 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-16 18:56:25 +0200 |
commit | ffad34816722cdf27a0a7c16539ddd1d655602e0 (patch) | |
tree | 5ced42864dd575d44d9105e7d503fe2628113308 | |
parent | a57af897ec16976b28de05aa0b9c3f6a96d73ede (diff) | |
parent | 767073fb9645f5cb0976a14288c03fe71912b569 (diff) |
Merge #19705: Shrink CAddress from 48 to 40 bytes on x64
767073fb9645f5cb0976a14288c03fe71912b569 Shrink CAddress from 48 to 40 bytes on x64 (Vasil Dimov)
Pull request description:
`CAddress` inherits `CService` which is 28 bytes (on 64 bit machines).
`CAddress` then adds two member variables - one that requires 4 byte
alignment (`nTime`) and one that requires 8 byte alignment
(`nServices`).
Declare the smaller one first so that it fits in bytes 29..32.
On 32 bit machines this change has no effect and `CAddress` remains 40
bytes.
ACKs for top commit:
laanwj:
ACK 767073fb9645f5cb0976a14288c03fe71912b569
theStack:
ACK https://github.com/bitcoin/bitcoin/commit/767073fb9645f5cb0976a14288c03fe71912b569
Tree-SHA512: 73d6a4fcfa2687b4076950801871252e369510ecf09f820576dbeca9ee3ee94d14672e7d5596cb45fedd9e4b973dd0716a2ea3f13fc3058b4b697d036a7c9db0
-rw-r--r-- | src/protocol.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/protocol.h b/src/protocol.h index 0bef12ee62..9565f5ff96 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -374,9 +374,10 @@ public: READWRITEAS(CService, obj); } - ServiceFlags nServices{NODE_NONE}; // disk and network only uint32_t nTime{TIME_INIT}; + + ServiceFlags nServices{NODE_NONE}; }; /** getdata message type flags */ |