Mono Class Library: System.Runtime.InteropServices.StructLayoutAttribute Overview | Members

System.Runtime.InteropServices.StructLayoutAttribute.Pack Field

A int that indicates the packing alignment used with the LayoutKind.Sequential layout.

public int Pack

Remarks

The StructLayoutAttribute.Pack field determines memory alignment of data fields of a target object.

Data fields of a target object exported to unmanaged memory are aligned on a byte boundary that is a multiple of StructLayoutAttribute.Pack bytes, or at some natural alignment for that field type, whichever is smaller.

The value of StructLayoutAttribute.Pack is required to be 0, 1, 2, 4, 8, 16, 32, 64, or 128. A value of zero indicates that the packing alignment is set to the default for the current platform. The default value is implementation-defined.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0