Skip to content

Zcu: allow atomic operations on packed structs#20590

Merged
andrewrk merged 1 commit intoziglang:masterfrom
jacobly0:atomic-packed-structs
Jul 12, 2024
Merged

Zcu: allow atomic operations on packed structs#20590
andrewrk merged 1 commit intoziglang:masterfrom
jacobly0:atomic-packed-structs

Conversation

@jacobly0
Copy link
Member

Same validation rules as the backing integer would have.

Same validation rules as the backing integer would have.
@SeanTUT
Copy link
Contributor

SeanTUT commented Jul 12, 2024

This would probably be beneficial for std.atomic.Value, which currently wraps the underlying type in an extern struct, but this approach makes it impossible to use non ABI width integers/enums with a std.atomic.Value, whereas if a packed struct were used instead, non aligned bit widths could be used in atomics

@andrewrk andrewrk merged commit 3ad81c4 into ziglang:master Jul 12, 2024
@andrewrk andrewrk added the release notes This PR should be mentioned in the release notes. label Jul 12, 2024
@jacobly0 jacobly0 deleted the atomic-packed-structs branch July 12, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes This PR should be mentioned in the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants