Ejemplo n.º 1
0
 internal static void Memmove <T>(ref T destination, ref T source, nuint elementCount)
 {
     if (!RuntimeHelpers.IsReferenceOrContainsReferences <T>())
     {
         unsafe {
             fixed(byte *pDestination = &Unsafe.As <T, byte>(ref destination), pSource = &Unsafe.As <T, byte>(ref source))
             Memmove(pDestination, pSource, (uint)elementCount * (uint)Unsafe.SizeOf <T>());
         }
     }
     else
     {
         unsafe {
             fixed(byte *pDestination = &Unsafe.As <T, byte>(ref destination), pSource = &Unsafe.As <T, byte>(ref source))
             RuntimeImports.Memmove_wbarrier(pDestination, pSource, (uint)elementCount, typeof(T).TypeHandle.Value);
         }
     }
 }