Capturing it by reference instead of value should save us from making a copy of a potentially large object. Saw this while having a look at #25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue.
rpc: Capture UniValue by ref for rpcdoccheck #25237
pull mzumsande wants to merge 1 commits into bitcoin:master from mzumsande:202205_rpcdoc_capture changing 1 files +1 −1-
mzumsande commented at 1:00 PM on May 29, 2022: member
-
rpc: Capture potentially large UniValue by ref for rpcdoccheck 20ff4991e5
-
MarcoFalke commented at 1:20 PM on May 29, 2022: member
Introduced in fa8192f42e1d24444f1d0433c96dbce1adf76967
review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872
- MarcoFalke added the label RPC/REST/ZMQ on May 29, 2022
- MarcoFalke added the label Resource usage on May 29, 2022
- MarcoFalke added the label Needs backport (22.x) on May 29, 2022
- MarcoFalke added the label Needs backport (23.x) on May 29, 2022
- MarcoFalke added this to the milestone 23.1 on May 29, 2022
- theStack approved
-
theStack commented at 2:51 PM on May 29, 2022: member
Code-review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872
-
furszy commented at 6:50 PM on May 29, 2022: member
Code ACK 20ff4991
- fanquake merged this on May 30, 2022
- fanquake closed this on May 30, 2022
-
MarcoFalke commented at 8:42 AM on May 30, 2022: member
https://github.com/bitcoin-core/univalue-subtree/pull/27 might have helped to discover this bug?
- fanquake removed the label Needs backport (22.x) on May 30, 2022
- fanquake removed the label Needs backport (23.x) on May 30, 2022
-
laanwj commented at 9:27 AM on May 30, 2022: member
Post-merge ACK. Very good catch, I imagine this could result in quite a lot of allocation, copy and reallocation overhead for complex objects.
- sidhujag referenced this in commit 38c4651715 on May 30, 2022
- mzumsande deleted the branch on May 31, 2022
- DrahtBot locked this on May 31, 2023
Milestone
23.1