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.
- Tipo
- final attribute
- Espacio de nombres
- System.Runtime.InteropServices
- Ensamblado
- System.Core
- Acceso
- public, final
- Archivo fuente
Interop.ant
Herencia
Constructores
Campos
Sequential or explicit.
The largest alignment a field gets (1, 2, 4, 8 or 16; 0: each field's own).
The value's size in bytes when it must be larger than its fields (0: what the fields need).
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
ValueLayoutAttribute en Antril, descompilado a partir de su Larva HIR.
// 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;
}
}
}