Example #1
0
 public void Clear(ref UnmanagedArray <T> target, SerializationContext context)
 {
     // nothing to clear since T is a pure value type
 }
Example #2
0
 public void Clone(UnmanagedArray <T> instance, ref UnmanagedArray <T> target, SerializationContext context)
 {
     Buffer.MemoryCopy((void *)instance.data, (void *)target.data, target.length, instance.Length);
 }
Example #3
0
 public void Dispose()
 {
     this.array    = null;
     this.position = IntPtr.Zero;
     this.last     = IntPtr.Zero;
 }
Example #4
0
            private UnmanagedArray <T> array; // to keep alive

            public UnmanagedEnumerator(UnmanagedArray <T> array)
            {
                this.array    = array;
                this.position = array.data - UnmanagedArray <T> .ElementSize;
                this.last     = array.data + ((array.Length - 1) * UnmanagedArray <T> .ElementSize);
            }
Example #5
0
 /// <summary>
 /// Copies all the elements of the current one-dimensional array to the specified one-dimensional array.
 /// </summary>
 /// <param name="destination">The one-dimensional array that is the destination of the elements copied from the current array.</param>
 /// <param name="index">The index in the destination array at which copying begins.</param>
 public void CopyTo(UnmanagedArray <T> destination, int index)
 {
     this.CopyTo(destination, 0, 0, this.length);
 }
Example #6
0
 /// <summary>
 /// Copies all the elements of the current one-dimensional array to the specified one-dimensional array.
 /// </summary>
 /// <param name="destination">The one-dimensional array that is the destination of the elements copied from the current array.</param>
 public void CopyTo(UnmanagedArray <T> destination)
 {
     this.CopyTo(destination, 0);
 }