-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make GCMemoryInfoData blittable #58738
Conversation
The runtime side makes assumptions about the layout of this class, but since the class is not blittable, the runtime is free to reorder the fields however it sees fit (`StructLayout(LayoutKind.Sequential)` only affects the *managed* layout of blittable classes - it's not documented to do anything to the managed layout of non-blittable classes). This prevents improvements to managed layout such as dotnet#51416.
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.
Thanks
Sigh. If I'm reading the tea leaves right, his is failing on 32bit platforms because the native side will try to align the beginning of I wonder if the best course of action would be to just rewrite the FCall to take a reference to the first field of |
@MichalStrehovsky PTLA at my suggested fix. |
Clever! Thank you! I've re-kicked the failing CI leg because it looks like the known infra issue (collection was modified). |
The runtime side makes assumptions about the layout of this class, but since the class is not blittable, the runtime is free to reorder the fields however it sees fit (
StructLayout(LayoutKind.Sequential)
only affects the managed layout of blittable classes - it's not documented to do anything to the managed layout of non-blittable classes).This prevents improvements to managed layout such as #51416.