a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
25 lines
357 B
C#
25 lines
357 B
C#
// Compiler options: -unsafe
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
class UnsafeTest
|
|
{
|
|
[StructLayout (LayoutKind.Sequential)]
|
|
public unsafe struct Foo
|
|
{
|
|
public Bar* bar;
|
|
}
|
|
|
|
[StructLayout (LayoutKind.Sequential)]
|
|
public struct Bar
|
|
{
|
|
public Foo foo;
|
|
}
|
|
|
|
unsafe public static void Main ()
|
|
{
|
|
Console.WriteLine (sizeof (Foo));
|
|
}
|
|
}
|