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

block-buffer: improve safety comments, use MaybeUninit for internal buffer #1081

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

newpavlov
Copy link
Member

@newpavlov newpavlov commented Jun 19, 2024

Marks private unchecked methods as unsafe and documents their safety requirements. Adds SAFETY comment for all unsafe uses. Use of copy_nonoverlapping ensures that compiler will not generate unreachable panic branches. Use of MaybeUninit removes unnecessary initialization and helps to test that we do not read bytes which were not written by us.

The code successfully passes MIRI tests, but I plan to test this implementation more thoroughly later.

@newpavlov newpavlov requested a review from tarcieri June 19, 2024 16:15
@newpavlov newpavlov merged commit cb18faa into master Jun 24, 2024
8 checks passed
@newpavlov newpavlov deleted the block-buffer/uninit branch June 24, 2024 14:05
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