示例#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);
        }
示例#2
0
 public FakePtr(FakePtr <T> ptr, int offset)
 {
     Offset = ptr.Offset + offset;
     _array = ptr._array;
 }
示例#3
0
 public void memcpy(FakePtr <T> b, int count)
 {
     Array.Copy(b._array, b.Offset, _array, Offset, count);
 }
示例#4
0
 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);
 }