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
  1. mzumsande commented at 1:00 PM on May 29, 2022: contributor

    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.

  2. rpc: Capture potentially large UniValue by ref for rpcdoccheck 20ff4991e5
  3. MarcoFalke commented at 1:20 PM on May 29, 2022: member

    Introduced in fa8192f42e1d24444f1d0433c96dbce1adf76967

    review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872

  4. MarcoFalke added the label RPC/REST/ZMQ on May 29, 2022
  5. MarcoFalke added the label Resource usage on May 29, 2022
  6. MarcoFalke added the label Needs backport (22.x) on May 29, 2022
  7. MarcoFalke added the label Needs backport (23.x) on May 29, 2022
  8. MarcoFalke added this to the milestone 23.1 on May 29, 2022
  9. theStack approved
  10. theStack commented at 2:51 PM on May 29, 2022: contributor

    Code-review ACK 20ff4991e548630d7bb5e491fa4d69ec49369872

  11. mzumsande cross-referenced this on May 29, 2022 from issue Memory leak via API listtransactions by CWDT250
  12. furszy commented at 6:50 PM on May 29, 2022: member

    Code ACK 20ff4991

  13. fanquake merged this on May 30, 2022
  14. fanquake closed this on May 30, 2022

  15. 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?

  16. fanquake removed the label Needs backport (22.x) on May 30, 2022
  17. fanquake removed the label Needs backport (23.x) on May 30, 2022
  18. fanquake commented at 8:48 AM on May 30, 2022: member

    Backports in #25241 and #25242.

  19. 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.

  20. sidhujag referenced this in commit 38c4651715 on May 30, 2022
  21. mzumsande deleted the branch on May 31, 2022
  22. bitcoin locked this on May 31, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC