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

Reduce unsafe code in array queue/bounded channel #774

Merged
merged 1 commit into from
Jan 22, 2022
Merged

Reduce unsafe code in array queue/bounded channel #774

merged 1 commit into from
Jan 22, 2022

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Jan 22, 2022

Before #458, since destructors could be called on elements, the correct way was to convert the Vec to a pointer, save it, and then deallocate it as a Vec with zero length. However, after #458, destructors of the elements wrapped by MaybeUninit are not called, so there is no need to save the Vec/boxed slice as a pointer. This removes the unsafe code that has caused several (potential) unsoundnesses in the past (#500, #533, #763).

@taiki-e taiki-e changed the title Reduce unsafe code from array queue Reduce unsafe code in array queue/bounded channel Jan 22, 2022
@taiki-e
Copy link
Member Author

taiki-e commented Jan 22, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 22, 2022

Build succeeded:

@bors bors bot merged commit 6465d5e into master Jan 22, 2022
@bors bors bot deleted the buf branch January 22, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant