Skip to content

Check the base address against the element alignment rather than stride #70911

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

Merged
merged 4 commits into from
Jan 15, 2024

Conversation

stephentyrone
Copy link
Contributor

Stride is the gap between elements, not the alignment that each element must satisfy (stride need not even be a power of two).

Stride is the gap between elements, not the alignment that each element must satisfy (stride need not even be a power of two).
@stephentyrone stephentyrone requested a review from a team as a code owner January 13, 2024 22:02
@stephentyrone
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

It was right in withMemoryRebound and somehow this happened. Thanks!

@glessard
Copy link
Contributor

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

Of all the little things about operator precedence in Swift, this is the one I dislike the most.

it seems this would have failed on 32bit with strict alignment enforcement
@glessard glessard force-pushed the check-alignment-not-stride branch from 59fd7ba to 67d41ac Compare January 15, 2024 10:23
@glessard
Copy link
Contributor

@swift-ci please test

@glessard
Copy link
Contributor

@swift-ci please test windows platform

Also get 80c formatting on these calls.
@stephentyrone
Copy link
Contributor Author

@swift-ci smoke test

@stephentyrone
Copy link
Contributor Author

(Using UInt for alignment was never a problem on 32b platforms because all the platforms we support have a minimum dynamic allocation alignment of 8B, but we should fix it anyway.)

@glessard glessard enabled auto-merge January 15, 2024 17:48
@glessard glessard merged commit e773d9a into swiftlang:main Jan 15, 2024
@stephentyrone stephentyrone deleted the check-alignment-not-stride branch January 15, 2024 21:28
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