diff options
author | Ahson Khan <ahkha@microsoft.com> | 2018-04-12 21:52:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 21:52:24 -0700 |
commit | d47cd47de2d9ca7ee9b577cb2c6db7ee7818f35a (patch) | |
tree | d90616b73b1a5edc2c80334639f2fcf39f4ffc2b | |
parent | c29b30bc4c7bf976db6fcf2c44e352920ace63aa (diff) | |
download | coreclr-d47cd47de2d9ca7ee9b577cb2c6db7ee7818f35a.tar.gz coreclr-d47cd47de2d9ca7ee9b577cb2c6db7ee7818f35a.tar.bz2 coreclr-d47cd47de2d9ca7ee9b577cb2c6db7ee7818f35a.zip |
Remove CreateFromPinnedArray from Memory (moved to MemoryMarshal) (#17532)
-rw-r--r-- | src/mscorlib/shared/System/Memory.cs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/mscorlib/shared/System/Memory.cs b/src/mscorlib/shared/System/Memory.cs index a500ec5b92..26f4e4ce19 100644 --- a/src/mscorlib/shared/System/Memory.cs +++ b/src/mscorlib/shared/System/Memory.cs @@ -162,37 +162,6 @@ namespace System _length = length; } - /// <summary> - /// Creates a new memory over the portion of the pre-pinned target array beginning - /// at 'start' index and ending at 'end' index (exclusive). - /// </summary> - /// <param name="array">The pre-pinned target array.</param> - /// <param name="start">The index at which to begin the memory.</param> - /// <param name="length">The number of items in the memory.</param> - /// <remarks>Returns default when <paramref name="array"/> is null.</remarks> - /// <exception cref="System.ArrayTypeMismatchException">Thrown when <paramref name="array"/> is covariant and array's type is not exactly T[].</exception> - /// <exception cref="System.ArgumentOutOfRangeException"> - /// Thrown when the specified <paramref name="start"/> or end index is not in the range (<0 or >=Length). - /// </exception> - [EditorBrowsable(EditorBrowsableState.Never)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Memory<T> 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<T>((object)array, start, length | (1 << 31)); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] internal Memory(object obj, int start, int length) { |