final attribute · System.Runtime.InteropServices

ValueLayoutAttribute

public final attribute ValueLayout

[ValueLayout(Layout.Explicit, Size = 128)], [ValueLayout(Layout.Sequential, Pack = 1)] on a value: its fields where C would put them, for structs and unions that cross to C by pointer. The fields hold numbers, bools, pointers, func*, inline arrays and other such values (no objects); reading or writing one is unsafe memory access, so the value is meant for interop.

Kind
final attribute
Namespace
System.Runtime.InteropServices
Assembly
System.Core
Access
public, final
Source file
Interop.ant

Inheritance

Base classes
Any Attribute ValueLayoutAttribute

Constructors

new(Layout kind)
#

Fields

Layout Kind
#

Sequential or explicit.

i32 Pack
#

The largest alignment a field gets (1, 2, 4, 8 or 16; 0: each field's own).

i32 Size
#

The value's size in bytes when it must be larger than its fields (0: what the fields need).

Inherited members (5)

Source

ValueLayoutAttribute as Antril, decompiled from its Larva HIR.

System.Runtime.InteropServices.ValueLayoutAttribute.ant
// System.Runtime.InteropServices.ValueLayoutAttribute — System.Core (decompiled from Larva HIR)

into namespace System.Runtime.InteropServices
{
	/// `[ValueLayout(Layout.Explicit, Size = 128)]`, `[ValueLayout(Layout.Sequential, Pack = 1)]` on a `value`: its
	/// fields where C would put them, for structs and unions that cross to C by pointer. The fields hold numbers, bools,
	/// pointers, `func*`, inline arrays and other such values (no objects); reading or writing one is unsafe memory
	/// access, so the value is meant for interop.
	public final attribute ValueLayout
	{
		public:
			/// Sequential or explicit.
			Layout Kind;

			/// The largest alignment a field gets (1, 2, 4, 8 or 16; 0: each field's own).
			i32 Pack;

			/// The value's size in bytes when it must be larger than its fields (0: what the fields need).
			i32 Size;

			new(Layout kind)
			{
				Kind = kind;
			}
	}
}
Esc