mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge #6233: fix: release unused memory in CNetMsgMaker::Make()
c2c4b2b794
fix: release unused memory in `CNetMsgMaker::Make()` (UdjinM6) Pull request description: ## Issue being fixed or feature implemented We reserve capacity for large messages in `CNetMsgMaker::Make()` but most messages are small yet we never release unused memory here. Discovered while debugging 28165 backport issues. ## What was done? ## How Has This Been Tested? ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone ACKs for top commit: kwvg: ACKc2c4b2b794
PastaPastaPasta: utACKc2c4b2b794
knst: utACKc2c4b2b794
Tree-SHA512: 72a3728e316fb76ca135fbfff4f15b80c60b048d7e916d2f5dbcde4b64dce7177af80f8f24153636ccfab2f5d5c7d9edc5b3bdba121f64c8da03117a98fd7411
This commit is contained in:
commit
d16e95352c
@ -21,6 +21,7 @@ public:
|
||||
msg.m_type = std::move(msg_type);
|
||||
msg.data.reserve(4 * 1024);
|
||||
CVectorWriter{ SER_NETWORK, nFlags | nVersion, msg.data, 0, std::forward<Args>(args)... };
|
||||
msg.data.shrink_to_fit();
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user