Mono Class Library: System.Runtime.CompilerServices Namespace

System.Runtime.CompilerServices.CompilationRelaxationsAttribute Class

This attribute allows the user to specify whether the ordering of instruction checking is strict or relaxed. It also allows the user to specify whether or not strings are interned. [Edit]

See Also: CompilationRelaxationsAttribute Members

System.Object
     System.Attribute
          System.Runtime.CompilerServices.CompilationRelaxationsAttribute

[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Module | System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.All)]
[System.Runtime.InteropServices.ComVisible(true)]
public class CompilationRelaxationsAttribute : Attribute

Remarks

Optimizers are granted additional latitude for relaxed exceptions. A method is relaxed for certain kinds of exceptions if the innermost custom attribute System.Runtime.CompilerServices.CompilationRelaxationAttribute pertaining to that kind of exception is present and specifies to relax those kinds of exceptions. (Here, "innermost" means inspecting the method, its class, and its assembly, in that order.)

Note: For background and implementation information for relaxed exception handling, plus examples, see Annex F of Partition VI.

Note: See the System.Runtime.CompilerServices.CompilationRelaxations enumeration for a description of the kinds of exceptions that can be relaxed or made strict.

The runtime can create one string object for each unique string literal, rather than making multiple copies. This is called string interning, which internally requires building auxiliary tables that consume memory resources. String interning can be enabled or disabled at the assembly level via this attribute.

[Edit]

Requirements

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