Page MenuHomePhabricator

[Radix] Use RCUPtr to keep track of items in the tree
ClosedPublic

Authored by deadalnix on Jan 21 2019, 16:55.

Details

Summary

This ensures that ownership can be shared in between the tree and its users, and ensures that elements gets cleaned up properly as all owners get rid of references to them.

The tree is steal leaking it's internal nodes on destructions.

Depends on D2336, D2351 and D2352

Test Plan

Added test cases.

Diff Detail

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

Event Timeline

Remove call to synchronize now that it is not needed as we use RCUPtr.

Rebase on top of patches using the NULLPTR trick to make old versions of boost happy.

Fabien requested changes to this revision.Jan 30 2019, 07:37
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/test/radix_tests.cpp
291 ↗(On Diff #7010)

Why !! ?
Is this an operator I'm not aware of, or a double negation ?

src/test/rcu_tests.cpp
147 ↗(On Diff #7010)

Why do you need this ? It seems unrelated to the other parts of the diff

This revision now requires changes to proceed.Jan 30 2019, 07:37
deadalnix added inline comments.
src/test/radix_tests.cpp
291 ↗(On Diff #7010)

It is a double negation. It's a common way to force bool conversion.

src/test/rcu_tests.cpp
147 ↗(On Diff #7010)

The cleanup queue is not going to clear itself up.

This revision is now accepted and ready to land.Jan 31 2019, 08:30
This revision was automatically updated to reflect the committed changes.