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

BytesMut: Assert alignment of Shared #652

Merged
merged 1 commit into from Jan 19, 2024

Conversation

braddunbar
Copy link
Contributor

Back in #362, an assertion was added to ensure that the alignment of bytes::Shared is even so we can use the least significant bit as a flag. bytes_mut::Shared uses the same technique but has no such assertion so I've added one here.

Back in tokio-rs#362, an assertion was added to ensure that the alignment of
bytes::Shared is even so we can use the least significant bit as a flag.
bytes_mut::Shared uses the same technique but has no such assertion so
I've added one here.
@braddunbar
Copy link
Contributor Author

Also, if this is acceptable I'd like to try abstracting things a bit to make it more clear that both sections use the same technique and how it works. As a newcomer to this codebase, I found it pretty tough to understand what was going on.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit abb4a2e into tokio-rs:master Jan 19, 2024
15 checks passed
@braddunbar braddunbar deleted the assert-align-of-shared branch January 19, 2024 11:59
@braddunbar braddunbar mentioned this pull request Mar 22, 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.

None yet

2 participants