System.Runtime.CompilerServices.RuntimeHelpers Class

public sealed class RuntimeHelpers

Base Types

Object
  RuntimeHelpers

Assembly

mscorlib

Library

RuntimeInfrastructure

Summary

Implements static methods and properties that provide special support for compilers.

Description

[Note: The types in System.Runtime.CompilerServices are intended primarily for use by compilers, not application programmers. They allow compilers to easily implement certain language features that are not directly visible to programmers.]

See Also

System.Runtime.CompilerServices Namespace

Members

RuntimeHelpers Methods

RuntimeHelpers.InitializeArray Method
RuntimeHelpers.RunClassConstructor Method

RuntimeHelpers Properties

RuntimeHelpers.OffsetToStringData Property


RuntimeHelpers.InitializeArray Method

public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle);

Summary

Provides a fast way to initialize a Array from data stored in a module.

Parameters

array
The Array to be initialized.
fldHandle
A RuntimeFieldHandle specifying the location of the data used to initialize array .

Description

This method is for compiler use only.

See Also

System.Runtime.CompilerServices.RuntimeHelpers Class, System.Runtime.CompilerServices Namespace

RuntimeHelpers.RunClassConstructor Method

public static void RunClassConstructor(RuntimeTypeHandle type);

Summary

Runs a specified class constructor method.

Parameters

type
A RuntimeTypeHandle specifying the class constructor method to run.

See Also

System.Runtime.CompilerServices.RuntimeHelpers Class, System.Runtime.CompilerServices Namespace

RuntimeHelpers.OffsetToStringData Property

public static int OffsetToStringData { get; }

Summary

Gets the number of bytes between the start of a String and the first Char in the string.

Property Value

A Int32 containing the number of bytes between the start of a String and the first Char in the string.

Description

This property is read-only.

[Note: This property is deprecated; its design is considered unnecessarily inflexible. It is expected that an improved design can be incorporated into the next revision of this Standard.

Compilers use this property for unsafe, but efficient, pointer operations on the characters in a managed string. Compilers should pin the string against movement by the garbage collector prior to use. Note that strings are immutable: their contents can be read but not changed.

The contents of these offset bytes are implementation-defined.

]

See Also

System.Runtime.CompilerServices.RuntimeHelpers Class, System.Runtime.CompilerServices Namespace