public static unsafe void PrepareMethod( RuntimeMethodHandle method, RuntimeTypeHandle[]?instantiation ) { IRuntimeMethodInfo methodInfo = method.GetMethodInfo(); if (methodInfo == null) { throw new ArgumentException( SR.InvalidOperation_HandleIsNotInitialized, nameof(method) ); } // defensive copy of user-provided array, per CopyRuntimeTypeHandles contract instantiation = (RuntimeTypeHandle[]?)instantiation?.Clone(); IntPtr[]? instantiationHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles( instantiation, out int length ); fixed(IntPtr *pInstantiation = instantiationHandles) { PrepareMethod(methodInfo.Value, pInstantiation, length); GC.KeepAlive(instantiation); GC.KeepAlive(methodInfo); } }
public static unsafe void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) { int num; fixed(IntPtr *ptrRef = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out num)) { _PrepareMethod(method.GetMethodInfo(), ptrRef, num); GC.KeepAlive(instantiation); } }
public static unsafe void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) { int length; fixed(IntPtr *pInstantiation = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out length)) { RuntimeHelpers._PrepareMethod(method.GetMethodInfo(), pInstantiation, length); GC.KeepAlive((object)instantiation); } }
public unsafe static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) { int cInstantiation; IntPtr[] array = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out cInstantiation); fixed(IntPtr *ptr = array) { RuntimeHelpers._PrepareMethod(method.GetMethodInfo(), ptr, cInstantiation); GC.KeepAlive(instantiation); } }
public static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[]?instantiation) { unsafe { IntPtr[]? instantiationHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out int length); fixed(IntPtr *pInstantiation = instantiationHandles) { _PrepareMethod(method.GetMethodInfo(), pInstantiation, length); GC.KeepAlive(instantiation); } } }
public static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[]?instantiation) { // defensive copy of user-provided array, per CopyRuntimeTypeHandles contract instantiation = (RuntimeTypeHandle[]?)instantiation?.Clone(); unsafe { IntPtr[]? instantiationHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out int length); fixed(IntPtr *pInstantiation = instantiationHandles) { _PrepareMethod(method.GetMethodInfo(), pInstantiation, length); GC.KeepAlive(instantiation); } } }
public static void PrepareMethod(RuntimeMethodHandle method, RuntimeTypeHandle[] instantiation) { if (method.IsNullHandle()) { throw new ArgumentException(SR.Argument_InvalidHandle); } unsafe { IntPtr[] instantiations = RuntimeTypeHandle.CopyRuntimeTypeHandles(instantiation, out int length); fixed(IntPtr *pinst = instantiations) { PrepareMethod(method.Value, pinst, length); GC.KeepAlive(instantiation); } } }