class · System.Runtime.InteropServices

ValueLayoutAttribute

public class System.Runtime.InteropServices.ValueLayoutAttribute : System.Attribute

[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
class
Namespace
System.Runtime.InteropServices
Assembly
System.Core
Access
public, final
Source file
Interop.ant

Inheritance

Base classes
Any Attribute ValueLayoutAttribute

Constructors

constructor ValueLayoutAttribute(kind: System.Runtime.InteropServices.Layout)
#

Fields

Sequential or explicit.

field Pack: i32
#

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

field Size: i32
#

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 Larva HIR, decompiled from its Larva HIR.

System.Runtime.InteropServices.ValueLayoutAttribute.hir
// `[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 class System.Runtime.InteropServices.ValueLayoutAttribute : System.Attribute
{
    // Sequential or explicit.
    field Kind: System.Runtime.InteropServices.Layout
    // The largest alignment a field gets (1, 2, 4, 8 or 16; 0: each field's own).
    field Pack: i32
    // The value's size in bytes when it must be larger than its fields (0: what the fields need).
    field Size: i32
    constructor ValueLayoutAttribute(kind: System.Runtime.InteropServices.Layout)
}
Esc