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

Fix miri issues with bbbul #1

Merged
merged 4 commits into from
Nov 25, 2024
Merged

Fix miri issues with bbbul #1

merged 4 commits into from
Nov 25, 2024

Conversation

dureuill
Copy link
Collaborator

As we are building a forward linked list, by the time we modify a node to set its successor, that node is already referenced in its predecessor.

That means that we cannot claim exclusive ownership to the node whose successor we want to set. Instead, we're using interior mutability to the next_node inside of the Node structure, so that we can do everything with shared references.

I previously attempted to work around this problem by introducing a before_tail structure member, but the same issue would recursively appear.

As we are building a forward linked list, by the time we modify a node to set its successor,
that node is already referenced in its predecessor.

That means that we cannot claim exclusive ownership to the node whose successor we want to set.
Instead, we're using interior mutability to the `next_node` inside of the `Node` structure, so
that we can do everything with shared references.
src/bbbul.rs Show resolved Hide resolved
@Kerollmops Kerollmops merged commit bd8decc into main Nov 25, 2024
20 checks passed
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.

2 participants