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

◆ Copy() [3/5]

static unsafe void System.Array.Copy ( Array sourceArray,
int sourceIndex,
Array destinationArray,
int destinationIndex,
int length )
inlinestatic

Definition at line 655 of file Array.cs.

656 {
657 if (sourceArray != null && destinationArray != null)
658 {
660 if (methodTable == RuntimeHelpers.GetMethodTable(destinationArray) && !methodTable->IsMultiDimensionalArray && length >= 0 && sourceIndex >= 0 && destinationIndex >= 0 && (uint)(sourceIndex + length) <= sourceArray.NativeLength && (uint)(destinationIndex + length) <= destinationArray.NativeLength)
661 {
662 nuint num = methodTable->ComponentSize;
663 nuint num2 = (uint)length * num;
664 ref byte reference = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(sourceArray).Data, (uint)sourceIndex * num);
665 ref byte reference2 = ref Unsafe.AddByteOffset(ref Unsafe.As<RawArrayData>(destinationArray).Data, (uint)destinationIndex * num);
666 if (methodTable->ContainsGCPointers)
667 {
668 Buffer.BulkMoveWithWriteBarrier(ref reference2, ref reference, num2);
669 }
670 else
671 {
673 }
674 return;
675 }
676 }
678 }
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static unsafe MethodTable * GetMethodTable(object obj)

References System.Buffer.BulkMoveWithWriteBarrier(), System.Array.Copy(), System.Runtime.CompilerServices.RawArrayData.Data, System.destinationArray, System.destinationIndex, System.Runtime.CompilerServices.RuntimeHelpers.GetMethodTable(), System.length, System.Buffer.Memmove(), System.sourceArray, and System.sourceIndex.