public static unsafe void TestSized4096CopyToStackAlloc0(ref Sized4096 a, ref Sized4096 b) { Sized4096 *c = stackalloc Sized4096[1]; (&c->First)[4] = 42; a = *c; }
public static unsafe void TestSized4096CopyToAlloca(ref Sized4096 a, ref Sized4096 b) { Sized4096 c = b; (&c.First)[4] = 42; a = c; }
public static unsafe void TestSized4096CopyToStackAlloc1(ref Sized4096 a, ref Sized4096 b) { byte * bytes = stackalloc byte[4096]; Sized4096 *c = (Sized4096 *)bytes; (&c->First)[4] = 42; a = *c; }
public static unsafe void TestSized4096ManualCopy(ref Sized4096 a, ref Sized4096 b) { for (int i = 0; i < UnsafeUtility.SizeOf <Sized4096>(); i++) { fixed(byte *aBytes = &a.First, bBytes = &b.First) { aBytes[i] = bBytes[i]; } } }
public static void TestMultipleSized4096CopyToAlloca(ref MultipleSized4096 a, ref Sized4096 b, ref Sized4096 c) { MultipleSized4096 d = default; d.a = b; b = d.b; c = a.a; a = d; }
public static void TestMultipleSized4096(ref MultipleSized4096 a, ref Sized4096 b) { a.a = b; a.a.First = 42; b = a.b; }
public static unsafe void TestSized4096(ref Sized4096 a, ref Sized4096 b) { a = b; }