mscorlib 2.0.0.0 4.0.0.0 System.Object

The C++ compiler uses the modifier to distinguish reference classes that are passed by managed reference from those passed by managed pointer. The class and its partner, the class, disambiguate reference parameters from pointer parameters.

Compilers emit custom modifiers within metadata to change the way that the just-in-time (JIT) compiler handles values when the default behavior is not appropriate. When the JIT compiler encounters a custom modifier, it handles the value in the way that the modifier specifies. Compilers can apply custom modifiers to methods, parameters, and return values. The JIT compiler must respond to required modifiers but can ignore optional modifiers.

You can emit custom modifiers into metadata using one of the following techniques:

Using methods in the class such as , , , and .

Generating a Microsoft intermediate language (MSIL) instruction file that contains calls to modopt and modreq, and assembling the file with the MSIL Assembler (Ilasm.exe).

Using the unmanaged reflection API.

Indicates that the modified garbage collection reference represents a reference parameter within a method signature. This class cannot be inherited.