Skip to content

Conversation

@mzumsande
Copy link
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.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in fa8192f

review ACK 20ff499

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-review ACK 20ff499

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code ACK 20ff499

@fanquake fanquake merged commit e3b7f10 into bitcoin:master May 30, 2022
@maflcko
Copy link
Member

maflcko commented May 30, 2022

bitcoin-core/univalue-subtree#27 might have helped to discover this bug?

@fanquake
Copy link
Member

Backports in #25241 and #25242.

@laanwj
Copy link
Member

laanwj commented May 30, 2022

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 pushed a commit to syscoin/syscoin that referenced this pull request May 30, 2022
20ff499 rpc: Capture potentially large UniValue by ref for rpcdoccheck (Martin Zumsande)

Pull request description:

  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 bitcoin#25229 although I couldn't reproduce an actual leak, so this is not a fix for that issue.

ACKs for top commit:
  MarcoFalke:
    review ACK 20ff499
  theStack:
    Code-review ACK 20ff499
  furszy:
    Code ACK 20ff499

Tree-SHA512: faf7bb14e37f8324b93a39095b07693626329da47c4a1ac8929bf99385e2e0567008e959e7e8540bc7d454d08fa41cccd39f55253c9a839fa88362922058a93b
@mzumsande mzumsande deleted the 202205_rpcdoc_capture branch May 31, 2022 19:18
@bitcoin bitcoin locked and limited conversation to collaborators May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants