Closed
Description
Context #100206 (comment)
Repro
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
Console.WriteLine(Unsafe.SizeOf<MyStruct>());
[StructLayout(LayoutKind.Explicit, Size = 9)]
struct MyStruct
{
[FieldOffset(0)]
public byte[] a;
[FieldOffset(8)]
public byte b;
}
Expected result (on x64)
16
Actual result
9