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
Mono doesn't respect explicit struct size when combined with sequential layout, i.e., when using [StructLayout(LayoutKind.Sequential, Size = X)], the structure doesn't have the desired size X.
Repro code:
using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Size = 12)]
struct F3_S0_S0
{
public nint F0;
public uint F1;
public F3_S0_S0(nint f0, uint f1)
{
F0 = f0;
F1 = f1;
}
}
private static void Main(string[] args)
{
Console.WriteLine(Marshal.SizeOf(typeof(F3_S0_S0)));
}