Exemple #1
0
        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);
        }
Exemple #2
0
 public FakePtr(FakePtr <T> ptr, int offset)
 {
     Offset = ptr.Offset + offset;
     _array = ptr._array;
 }
Exemple #3
0
 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);
 }