System.Runtime.CompilerServices.RuntimeHelpers Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.CompilerServices
Summary
Provides a set of static methods and properties that provide support for compilers.
C# Syntax:
[Serializable]
public sealed class RuntimeHelpers
Remarks
The classes in System.Runtime.CompilerServices are for compiler writers use only.
See also:
System.Runtime.CompilerServices Namespace

System.Runtime.CompilerServices.RuntimeHelpers Member List:

Public Properties
OffsetToStringData Read-only

Gets the offset in bytes to the data in the given string.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetObjectValue Boxes a value type.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
InitializeArray Provides a fast way to initialize an array from data stored in a module.
RunClassConstructor Runs a specified class constructor method.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Runtime.CompilerServices.RuntimeHelpers Member Details

Property: OffsetToStringData (read-only)
Summary
Gets the offset in bytes to the data in the given string.
C# Syntax:
public static int OffsetToStringData {get;}
Remarks
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 common language runtime strings are immutable, their contents can be read but not changed.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~RuntimeHelpers();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetObjectValue(
   object obj
)
Summary
Boxes a value type.
C# Syntax:
public static object GetObjectValue(
   object obj
);
Parameters:

obj

The value type to be boxed.

Return Value:
Returns a boxed copy of obj if it is a value class; otherwise obj itself is returned.
Remarks
Boxing a value type creates an object and performs a shallow copy of the fields of the specified value type into the new object.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: InitializeArray(
   Array array,
   RuntimeFieldHandle fldHandle
)
Summary
Provides a fast way to initialize an array from data stored in a module.
C# Syntax:
public static void InitializeArray(
   Array array,
   RuntimeFieldHandle fldHandle
);
Parameters:

array

The array to be initialized.

fldHandle

A RuntimeFieldHandle specifying the location of the data used to initialize the array.

Remarks
This method is for compiler use only.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: RunClassConstructor(
   RuntimeTypeHandle type
)
Summary
Runs a specified class constructor method.
C# Syntax:
public static void RunClassConstructor(
   RuntimeTypeHandle type
);
Parameters:

type

A RuntimeTypeHandler specifying the class constructor method to run.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.