Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 823 Bytes

ii.23.2.9-constraint.md

File metadata and controls

5 lines (3 loc) · 823 Bytes

II.23.2.9 Constraint

The Constraint item in Signatures currently has only one possible value, ELEMENT_TYPE_PINNEDII.23.1.16), which specifies that the target type is pinned in the runtime heap, and will not be moved by the actions of garbage collection.

A Constraint can only be applied within a LocalVarSig (not a FieldSig). The Type of the local variable shall either be a reference type (in other words, it points to the actual variable – for example, an Object, or a String); or it shall include the BYREF item. The reason is that local variables are allocated on the runtime stack – they are never allocated from the runtime heap; so unless the local variable points at an object allocated in the GC heap, pinning makes no sense.