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

Don't assume primitive alignments #116

Closed
joshlf opened this issue Nov 2, 2022 · 0 comments · Fixed by #118
Closed

Don't assume primitive alignments #116

joshlf opened this issue Nov 2, 2022 · 0 comments · Fixed by #118

Comments

@joshlf
Copy link
Member

joshlf commented Nov 2, 2022

Currently, a lot of our test code assumes that all primitive numerical types have an alignment equal to their size. This isn't true on all platforms, and so we should replace these uses with types with guaranteed alignment.

Credit to @djkoloski for pointing this out in #113 (comment).

joshlf added a commit that referenced this issue Nov 3, 2022
joshlf added a commit that referenced this issue Nov 3, 2022
joshlf added a commit that referenced this issue Nov 3, 2022
joshlf added a commit that referenced this issue Nov 3, 2022
joshlf added a commit that referenced this issue Nov 3, 2022
Previously, we used the `u16` and `u64` types in a number of tests,
relying on them having the alignments 2 and 8 respectively. While those
types have those alignments on many platforms, those are not guaranteed
to be their alignments on all platforms. In this commit, we replace
most of these uses with types of the same size but guaranteed alignment.
In a few places, we have to leave the uses as-is, but this isn't a big
deal since our tests run in CI on platforms where the alignments are
actually the values we're relying upon.

Closes #116
joshlf added a commit that referenced this issue Nov 3, 2022
Previously, we used the `u16` and `u64` types in a number of tests,
relying on them having the alignments 2 and 8 respectively. While those
types have those alignments on many platforms, those are not guaranteed
to be their alignments on all platforms. In this commit, we replace
most of these uses with types of the same size but guaranteed alignment.
In a few places, we have to leave the uses as-is, but this isn't a big
deal since our tests run in CI on platforms where the alignments are
actually the values we're relying upon.

Closes #116
joshlf added a commit that referenced this issue Nov 3, 2022
Previously, we used the `u16` and `u64` types in a number of tests,
relying on them having the alignments 2 and 8 respectively. While those
types have those alignments on many platforms, those are not guaranteed
to be their alignments on all platforms. In this commit, we replace
most of these uses with types of the same size but guaranteed alignment.
In a few places, we have to leave the uses as-is, but this isn't a big
deal since our tests run in CI on platforms where the alignments are
actually the values we're relying upon.

Closes #116
@joshlf joshlf closed this as completed in bc3c9ac Nov 5, 2022
joshlf added a commit that referenced this issue Aug 3, 2023
Previously, we used the `u16` and `u64` types in a number of tests,
relying on them having the alignments 2 and 8 respectively. While those
types have those alignments on many platforms, those are not guaranteed
to be their alignments on all platforms. In this commit, we replace
most of these uses with types of the same size but guaranteed alignment.
In a few places, we have to leave the uses as-is, but this isn't a big
deal since our tests run in CI on platforms where the alignments are
actually the values we're relying upon.

Closes #116
@joshlf joshlf mentioned this issue Aug 20, 2023
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 a pull request may close this issue.

1 participant