You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are use cases where structure has different alignment in 32 and 64 bits.
It would be very useful to be able to align structure by size of pointer or its derivative.
A possible solution mentioned in #33899 is to use two structures and introduce an interface.
However it means boxing and requires defining properties instead of simple fields.
Much more convenient solution is to allow packing depending on IntPtr.Size.
P.S.
It would be also nice to allow IntPtr.Size usage in arrays marshaling:
[StructLayout(LayoutKind.Sequential, Pack = IntPtr.Size)]public value struct typeData
{[MarshalAs(UnmanagedType.ByValArray,SizeConst= IntPtr.Size)]byte[]a1;}
The text was updated successfully, but these errors were encountered:
There are use cases where structure has different alignment in 32 and 64 bits.
It would be very useful to be able to align structure by size of pointer or its derivative.
A possible solution mentioned in #33899 is to use two structures and introduce an interface.
However it means boxing and requires defining properties instead of simple fields.
Much more convenient solution is to allow packing depending on IntPtr.Size.
P.S.
It would be also nice to allow IntPtr.Size usage in arrays marshaling:
The text was updated successfully, but these errors were encountered: