Fixed the bug that MemCpy does not work as expected

This commit is contained in:
2025-12-07 00:04:37 +09:00
parent f3b0f295a8
commit 0438fce10e
4 changed files with 20 additions and 20 deletions

View File

@@ -123,7 +123,7 @@ public unsafe struct UnTypedArray : IUnTypedCollection
fixed (T* pDest = destination)
{
MemCpy(_buffer, pDest, _size);
MemCpy(pDest, _buffer, _size);
}
}
@@ -147,7 +147,7 @@ public unsafe struct UnTypedArray : IUnTypedCollection
fixed (T* pDest = destination)
{
MemCpy((byte*)_buffer + sourceOffset, pDest + destinationIndex, length * sizeOfElement);
MemCpy(pDest + destinationIndex, (byte*)_buffer + sourceOffset, length * sizeOfElement);
}
}
@@ -169,7 +169,7 @@ public unsafe struct UnTypedArray : IUnTypedCollection
fixed (T* pSrc = source)
{
MemCpy(pSrc, _buffer, sourceSize);
MemCpy(_buffer, pSrc, sourceSize);
}
}
@@ -193,7 +193,7 @@ public unsafe struct UnTypedArray : IUnTypedCollection
fixed (T* pSrc = source)
{
MemCpy(pSrc + sourceIndex, (byte*)_buffer + destinationOffset, length * sizeOfElement);
MemCpy((byte*)_buffer + destinationOffset, pSrc + sourceIndex, length * sizeOfElement);
}
}