Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateFromPinnedArray< T >()

static Memory< T > System.Runtime.InteropServices.MemoryMarshal.CreateFromPinnedArray< T > ( T?[] array,
int start,
int length )
inlinestatic

Definition at line 331 of file MemoryMarshal.cs.

332 {
333 if (array == null)
334 {
335 if (start != 0 || length != 0)
336 {
337 ThrowHelper.ThrowArgumentOutOfRangeException();
338 }
339 return default(Memory<T>);
340 }
341 if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
342 {
343 ThrowHelper.ThrowArrayTypeMismatchException();
344 }
345 if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
346 {
347 ThrowHelper.ThrowArgumentOutOfRangeException();
348 }
349 return new Memory<T>((object)array, start | int.MinValue, length);
350 }

References System.array, System.length, System.start, System.ThrowHelper.ThrowArgumentOutOfRangeException(), and System.ThrowHelper.ThrowArrayTypeMismatchException().