From d47cd47de2d9ca7ee9b577cb2c6db7ee7818f35a Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Thu, 12 Apr 2018 21:52:24 -0700 Subject: [PATCH] Remove CreateFromPinnedArray from Memory (moved to MemoryMarshal) (#17532) --- src/mscorlib/shared/System/Memory.cs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/mscorlib/shared/System/Memory.cs b/src/mscorlib/shared/System/Memory.cs index a500ec5..26f4e4c 100644 --- a/src/mscorlib/shared/System/Memory.cs +++ b/src/mscorlib/shared/System/Memory.cs @@ -162,37 +162,6 @@ namespace System _length = length; } - /// - /// Creates a new memory over the portion of the pre-pinned target array beginning - /// at 'start' index and ending at 'end' index (exclusive). - /// - /// The pre-pinned target array. - /// The index at which to begin the memory. - /// The number of items in the memory. - /// Returns default when is null. - /// Thrown when is covariant and array's type is not exactly T[]. - /// - /// Thrown when the specified or end index is not in the range (<0 or >=Length). - /// - [EditorBrowsable(EditorBrowsableState.Never)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Memory CreateFromPinnedArray(T[] array, int start, int length) - { - if (array == null) - { - if (start != 0 || length != 0) - ThrowHelper.ThrowArgumentOutOfRangeException(); - return default; - } - if (default(T) == null && array.GetType() != typeof(T[])) - ThrowHelper.ThrowArrayTypeMismatchException(); - if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) - ThrowHelper.ThrowArgumentOutOfRangeException(); - - // Before using _length, check if _length < 0, then 'and' it with RemoveFlagsBitMask - return new Memory((object)array, start, length | (1 << 31)); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal Memory(object obj, int start, int length) { -- 2.7.4