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

memory_view: Avoid using bit field #8380

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Conversation

kou
Copy link
Member

@kou kou commented Sep 6, 2023

Bit field's memory layout is implementation-defined.

See also:
https://wiki.sei.cmu.edu/confluence/display/c/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields

If memory layout is implementation-defined, it's difficult to use from FFI library such as Ruby-FFI.

Bit field's memory layout is implementation-defined.

See also:
https://wiki.sei.cmu.edu/confluence/display/c/EXP11-C.+Do+not+make+assumptions+regarding+the+layout+of+structures+with+bit-fields

If memory layout is implementation-defined, it's difficult to use from
FFI library such as Ruby-FFI.
@kou
Copy link
Member Author

kou commented Sep 6, 2023

@mrkn What do you think about this?

@mrkn
Copy link
Member

mrkn commented Sep 6, 2023

@kou LGTM!!

@kou
Copy link
Member Author

kou commented Sep 6, 2023

Thanks!

I'll merge this in this week if nobody objects this.

@kou
Copy link
Member Author

kou commented Sep 8, 2023

I'll merge this.

@kou kou merged commit 90dad2b into ruby:master Sep 8, 2023
93 checks passed
@kou kou deleted the memory-view-avoid-bit-field branch September 8, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants