Previously, CoreCLR did not support explicit layout for structs on non-Windows platforms. To work around it, we ended up adding a bunch of dummy fields, such as this one, to make opaque structs the right size.
Now that explicit layout is supported, we should remove those dummy fields and pass LayoutKind.Explicit and the Size to the StructLayout attribute.
Previously, CoreCLR did not support explicit layout for structs on non-Windows platforms. To work around it, we ended up adding a bunch of dummy fields, such as this one, to make opaque structs the right size.
Now that explicit layout is supported, we should remove those dummy fields and pass
LayoutKind.Explicit
and theSize
to theStructLayout
attribute.