Ejemplo n.º 1
0
 public static unsafe void CopyMemory <T>(T[] to, IntPtr @from, int count) where T : struct
 {
     UnsafeNativeMethods.CopyMemory((byte *)SizeCache <T> .GetUnsafePtr(ref to[0]), (byte *)@from, count * SizeCache <T> .Size);
 }
Ejemplo n.º 2
0
 public static unsafe IntPtr CopyToUnmanaged <T>(this T[] @from, int count) where T : struct
 {
     return(count == 0 ? IntPtr.Zero : new IntPtr(SizeCache <T> .GetUnsafePtr(ref @from[0])));
 }