-
Notifications
You must be signed in to change notification settings - Fork 90
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
New codegen for inline array fields #140
Conversation
cf685fc
to
3ea4338
Compare
3ea4338
to
f3c72b7
Compare
internal uint dwWidth; | ||
internal uint dwHeight; | ||
internal __dwReserved_4 dwReserved; | ||
[StructLayout(LayoutKind.Sequential, Pack = 1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tannergooding were you saying we don't need to specify the pack size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Inline arrays are just like regular arrays and the natural padding of a struct is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(assuming the metadata doesn't specify otherwise)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saw that too. I can add this change to this PR, no problem. 👍
I've asked JaredPar on another thread to review and will report back here. |
Just an update: I am actively working on this and have lots of changes coming. I'm just working to get all tests passing. The new extension methods we have to declare bring on some new challenges. |
@AArnott Thanks for completing this! |
Thanks for starting it, @jnm2! Particularly because it led us to discover bugs in how we did it before. |
Update GitHub Actions to more closely resemble AzP
Closes #117
TODO:
ref p[index]
should beref Unsafe.AsRef<uint>(p + index)
Currently generated code (odd whitespace is not my fault; tracked by #23):
@AArnott I like keeping
unsafe
scoped as tightly as possible, meaning I use the statement form if the signature itself isn't unsafe, but let me know if this is too weird or something, or if using an embedded statement instead of a block inside thefixed
statement is a problem.