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

Be more cautious about drain drops #1030

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Mar 2, 2023

This makes a greater effort to ensure that in all cases where either
DrainProducer or SliceDrain will drop data, there are no references
left pointing to that memory. It's not actually clear that this would be
a problem anyway, as long as there's nothing accessing that zombie data,
but it's not too much trouble to avoid it.

Fixes #1029.

This makes a greater effort to ensure that in all cases where either
`DrainProducer` or `SliceDrain` will drop data, there are no references
left pointing to that memory. It's not actually clear that this would be
a problem anyway, as long as there's nothing accessing that zombie data,
but it's not too much trouble to avoid it.

Fixes rayon-rs#1029.
@cuviper
Copy link
Member Author

cuviper commented Mar 2, 2023

Oops, broke it because slice::as_mut_ptr() is not what I thought -- I'll fix that and make it more explicit.

@cuviper
Copy link
Member Author

cuviper commented Mar 2, 2023

bors r+

@bors bors bot merged commit 099241d into rayon-rs:master Mar 2, 2023
@cuviper cuviper deleted the drain-caution branch June 22, 2023 17:54
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.

Potential unsoundness in DrainProducer around drop_in_place on mutable reference
2 participants