Table of Contents

Class RuntimeHelpers

Namespace
System.Runtime.CompilerServices
Assembly
mscorlib.dll

Provides a set of static methods and properties that provide support for compilers. This class cannot be inherited.

public static class RuntimeHelpers
Inheritance
RuntimeHelpers
Inherited Members

Properties

OffsetToStringData

Gets the offset, in bytes, to the data in the given string.

public static int OffsetToStringData { get; }

Property Value

int

The byte offset, from the start of the String object to the first character in the string.

Methods

GetObjectValue(object)

Boxes a value type.

public static object GetObjectValue(object obj)

Parameters

obj object

The value type to be boxed.

Returns

object

A boxed copy of obj if it is a value class; otherwise, obj itself.

InitializeArray(Array, RuntimeFieldHandle)

Provides a fast way to initialize an array from data that is stored in a module.

public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle)

Parameters

array Array

The array to be initialized.

fldHandle RuntimeFieldHandle

A field handle that specifies the location of the data used to initialize the array.

RunClassConstructor(RuntimeTypeHandle)

Runs a specified class constructor method.

public static void RunClassConstructor(RuntimeTypeHandle type)

Parameters

type RuntimeTypeHandle

A type handle that specifies the class constructor method to run.