Page MenuHomePhabricator

Avoid a copy when inserting a mempool entry
ClosedPublic

Authored by Fabien on Jan 12 2024, 15:21.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC905c5b89f546: Avoid a copy when inserting a mempool entry
Summary

We already store a unique_ptr, so we can leverage this to avoid the copy.
To avoid creating new copies the copy constructor operator is explicitely deleted.
A move constructor also needs to be created as this is used in the tests.

Note that we don't need assignment operators because the class has const
members.

This will make it easier to reason about when we later update to a RCUPtr, because it uses
an atomic and cannot be copied.

Depends on D13443.

Test Plan
ninja all check-all

Run the asan build;

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable