Backends/SiaNet.Backend.TensorSharp/Core/MemoryCopier.cs
/// <summary>
/// Copies data from source to destination.
/// </summary>
/// <param name="destination">The destination memory pointer.</param>
/// <param name="source">The source memory pointer.</param>
/// <param name="length">The length of data.</param>
Copies data from source to destination.
Copies data from source to destination .
public static void Copy(IntPtr destination, IntPtr source, ulong length)
        {
            var is32 = IntPtr.Size == 4;
            if (is32)
            {
                NativeMethods32.RtlCopyMemory(destination, source, (uint)length);
            }
            else
            {
                NativeMethods64.RtlCopyMemory(destination, source, (ulong)length);
            }
        }
public static void Copy ( IntPtr destination , IntPtr source , ulong length ) { var is32 = IntPtr . Size == 4 ; if ( is32 ) { NativeMethods32 . RtlCopyMemory ( destination , source , ( uint ) length ) ; } else { NativeMethods64 . RtlCopyMemory ( destination , source , ( ulong ) length ) ; } }
Copies data from source to destination.
Copies data from source to destination .
// Note: if this is run, length should always be in range of a uint // (it should be impossible to allocate a buffer bigger than that range // on a 32-bit system)
destination
IntPtr
The destination memory pointer.
The destination memory pointer .
source
IntPtr
The source memory pointer.
The source memory pointer .
length
ulong
The length of data.
The length of data .