mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Enum System.Runtime.InteropServices.ComVisible(true)

Packing size affects the alignment of fields in structures and classes whose organization is . The packing size is one of two factors that determine the offset of a field when the structure or class is marshaled; the other factor is the effective size of the field. To determine the offset of a field:

Compute the minimum value for the offset by adding the size of the preceding field to the offset of the preceding field.

Compute the natural packing size for the field: If the field is a simple data type, use the size. If the field is an array, use the size of an array element. If the field is itself a structure, compare the packing size of that structure to the size of the largest field in that structure, and use the smaller of the two values.

Compute the effective packing size by comparing the packing size to the natural packing size of the field, computed in step 2. Use the smaller of the two numbers.

Compute the offset. The offset is the first memory location that is equal to or larger than the minimum, and a multiple of the effective packing size computed in step 3.

Once offsets have been computed for all the fields in the class or structure, padding is added so that the overall size is a multiple of the packing size.

For example, in a class containing a byte and a long, using packing size Size1, the offset of the byte field is zero (0) and the offset of the long field is one (1). If the packing size is Size4, the long field has offset four (4). In a class containing two short fields, using any packing size, the offset of the second short field is two (2).

Changing the packing size can affect performance if it causes fields to be aligned on offsets that are not multiples of their size.

Specifies one of two factors that determine the memory alignment of fields when a type is marshaled.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is 1 byte.

- Field
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize

  The packing size is 128 bytes.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is 16 bytes.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is 2 bytes.

- Field
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize

  The packing size is 32 bytes.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is 4 bytes.

- Field
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize

  The packing size is 64 bytes.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is 8 bytes.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Reflection.Emit.PackingSize To be added

  The packing size is not specified.