Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix a memleak with pollard #44

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

Davidson-Souza
Copy link
Collaborator

Before this commit we use Rc cycles to represent the forest's trees, but this creates some floating Rc's that never gets dropped, yelding a memory leak. This commit fixes this by using Weak references everywhere except for a node's children, since the node is meant to be owned by it's ancestor.

It is ok to upgrade those Weak references because they will never outlive the node itself.

@Davidson-Souza Davidson-Souza marked this pull request as ready for review February 15, 2024 12:44
Before this commit we use Rc cycles to represent the forest's trees, but
this creates some floating Rc's that never gets dropped, yelding a
memory leak. This commit fixes this by using Weak references everywhere
except for a node's children, since the node is meant to be owned by
it's ancestor.

It is ok to upgrade those Weak references because they will never
outlive the node itself.
@Davidson-Souza Davidson-Souza merged commit b572acc into mit-dci:main Feb 15, 2024
20 checks passed
Davidson-Souza added a commit to Davidson-Souza/rustreexo that referenced this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant