diff --git a/source/Cosmos.Core/MemoryOperations.cs b/source/Cosmos.Core/MemoryOperations.cs index b36ad8010e..61e0c5bb80 100644 --- a/source/Cosmos.Core/MemoryOperations.cs +++ b/source/Cosmos.Core/MemoryOperations.cs @@ -368,6 +368,24 @@ public static unsafe void Copy(byte[] aDest, int aDestOffset, byte[] aSrc, int a } } + /// + /// Copy source int array to destination int array. + /// + /// Destination int array. + /// Destination offset in int elements, not bytes. + /// Source int array. + /// Source offset in int elements, not bytes. + /// Count of int elements to copy, not bytes. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void Copy(int[] dest, int destOffset, int[] src, int srcOffset, int count) + { + fixed (int* destPtr = &dest[destOffset]) + fixed (int* srcPtr = &src[srcOffset]) + { + Copy(destPtr, srcPtr, count); + } + } + #endregion Copy } }