using System; using System.Runtime.ConstrainedExecution; namespace System.Runtime.CompilerServices { /// Provides a set of static methods and properties that provide support for compilers. This class cannot be inherited. // Token: 0x02000061 RID: 97 public static class RuntimeHelpers { // Token: 0x060006C0 RID: 1728 [MethodImpl(MethodImplOptions.InternalCall)] private static extern void InitializeArray(Array array, IntPtr fldHandle); /// Provides a fast way to initialize an array from data stored in a module. /// The array to be initialized. /// A specifying the location of the data used to initialize the array. // Token: 0x060006C1 RID: 1729 RVA: 0x00015294 File Offset: 0x00013494 public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle) { if (array == null || fldHandle.Value == IntPtr.Zero) { throw new ArgumentNullException(); } RuntimeHelpers.InitializeArray(array, fldHandle.Value); } /// Gets the offset in bytes to the data in the given string. /// The byte offset, from the start of the object to the first character in the string. // Token: 0x170000CB RID: 203 // (get) Token: 0x060006C2 RID: 1730 public static extern int OffsetToStringData { [MethodImpl(MethodImplOptions.InternalCall)] get; } /// Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures such as a hash table. /// A hash code for the identified by the parameter. /// An to retrieve the hash code for. // Token: 0x060006C3 RID: 1731 RVA: 0x000152C8 File Offset: 0x000134C8 public static int GetHashCode(object o) { return object.InternalGetHashCode(o); } /// Determines whether the specified instances are considered equal. /// true if the parameter is the same instance as the parameter or if both are null or if o1.Equals(o2) returns true; otherwise, false. /// The first to compare. /// The second to compare. // Token: 0x060006C4 RID: 1732 RVA: 0x000152D0 File Offset: 0x000134D0 public new static bool Equals(object o1, object o2) { if (o1 == o2) { return true; } if (o1 == null || o2 == null) { return false; } if (o1 is ValueType) { return ValueType.DefaultEquals(o1, o2); } return object.Equals(o1, o2); } /// Boxes a value type. /// Returns a boxed copy of if it is a value class; otherwise itself is returned. /// The value type to be boxed. // Token: 0x060006C5 RID: 1733 [MethodImpl(MethodImplOptions.InternalCall)] public static extern object GetObjectValue(object obj); // Token: 0x060006C6 RID: 1734 [MethodImpl(MethodImplOptions.InternalCall)] private static extern void RunClassConstructor(IntPtr type); /// Runs a specified class constructor method. /// A specifying the class constructor method to run. /// The class initializer threw an exception. // Token: 0x060006C7 RID: 1735 RVA: 0x00015304 File Offset: 0x00013504 public static void RunClassConstructor(RuntimeTypeHandle type) { if (type.Value == IntPtr.Zero) { throw new ArgumentException("Handle is not initialized.", "type"); } RuntimeHelpers.RunClassConstructor(type.Value); } /// Executes code using a while using another to execute additional code in case of an exception. /// A to the code to try. /// A to the code to run if a exception occurs. /// The data to pass to and . // Token: 0x060006C8 RID: 1736 RVA: 0x00015344 File Offset: 0x00013544 [MonoTODO("Currently a no-op")] public static void ExecuteCodeWithGuaranteedCleanup(RuntimeHelpers.TryCode code, RuntimeHelpers.CleanupCode backoutCode, object userData) { } /// Designates a body of code as a constrained execution region (CER). /// /// /// // Token: 0x060006C9 RID: 1737 RVA: 0x00015348 File Offset: 0x00013548 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] [MonoTODO("Currently a no-op")] public static void PrepareConstrainedRegions() { } /// Designates a body of code as a constrained execution region (CER) without performing any probing. // Token: 0x060006CA RID: 1738 RVA: 0x0001534C File Offset: 0x0001354C [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] [MonoTODO("Currently a no-op")] public static void PrepareConstrainedRegionsNoOP() { } /// Probes for a certain amount of stack space to ensure that a stack overflow cannot happen within a subsequent block of code (assuming that your code uses only a finite and moderate amount of stack space). We recommend that you use a constrained execution region (CER) instead of this method. // Token: 0x060006CB RID: 1739 RVA: 0x00015350 File Offset: 0x00013550 [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] [MonoTODO("Currently a no-op")] public static void ProbeForSufficientStack() { } /// Indicates that the specified delegate be prepared for inclusion in a constrained execution region (CER). /// The type to prepare. /// /// /// // Token: 0x060006CC RID: 1740 RVA: 0x00015354 File Offset: 0x00013554 [MonoTODO("Currently a no-op")] public static void PrepareDelegate(Delegate d) { if (d == null) { throw new ArgumentNullException("d"); } } /// Prepares a method for inclusion in a constrained execution region (CER). /// A to the method to prepare. /// /// /// // Token: 0x060006CD RID: 1741 RVA: 0x00015368 File Offset: 0x00013568 [MonoTODO("Currently a no-op")] public static void PrepareMethod(RuntimeMethodHandle method) { } /// Prepares a method for inclusion in a constrained execution region (CER) with the specified instantiation. /// A to the method to prepare. /// A instantiation to pass. /// /// /// // Token: 0x060006CE RID: 1742 RVA: 0x0001536C File Offset: 0x0001356C [MonoTODO("Currently a no-op")] public static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) { } /// Runs a specified module constructor method. /// A object specifying the module constructor method to run. /// The module constructor threw an exception. // Token: 0x060006CF RID: 1743 RVA: 0x00015370 File Offset: 0x00013570 public static void RunModuleConstructor(ModuleHandle module) { if (module == ModuleHandle.EmptyHandle) { throw new ArgumentException("Handle is not initialized.", "module"); } RuntimeHelpers.RunModuleConstructor(module.Value); } // Token: 0x060006D0 RID: 1744 [MethodImpl(MethodImplOptions.InternalCall)] public static extern void RunModuleConstructor(IntPtr module); /// Represents a delegate to code that should be run in a try block.. /// Data to pass to the delegate. // Token: 0x02000062 RID: 98 // (Invoke) Token: 0x060006D2 RID: 1746 public delegate void TryCode(object userData); /// Represents a method to run when an exception occurs. /// Data to pass to the delegate. /// true to express that an exception was thrown; otherwise, false. // Token: 0x02000063 RID: 99 // (Invoke) Token: 0x060006D6 RID: 1750 public delegate void CleanupCode(object userData, bool exceptionThrown); } }