public static FakePtr <T> CreateWithSize(int size) { var result = new FakePtr <T>(new T[size]); for (int i = 0; i < size; ++i) { result[i] = new T(); } return(result); }
public FakePtr(FakePtr <T> ptr, int offset) { Offset = ptr.Offset + offset; _array = ptr._array; }
public void memcpy(FakePtr <T> b, int count) { Array.Copy(b._array, b.Offset, _array, Offset, count); }
public static void memcpy <T>(this T[] a, FakePtr <T> b, int count) where T : new() { Array.Copy(b._array, b.Offset, a, 0, count); }