Example #1
0
        public NativeArrayBurst(T[] array, Allocator allocator)
        {
            if (array == null)
            {
                throw new ArgumentNullException(nameof(array));
            }
            NativeArrayBurst <T> .Allocate(array.Length, allocator, out this);

            NativeArrayBurst <T> .Copy(array, this);
        }
Example #2
0
 public static void Copy(T[] src, NativeArrayBurst <T> dst)
 {
     #if COLLECTIONS_CHECKS
     AtomicSafetyHandle.CheckWriteAndThrow(dst.m_Safety);
     if (src.Length != dst.Length)
     {
         throw new ArgumentException("source and destination length must be the same");
     }
     #endif
     NativeArrayBurst <T> .Copy(src, 0, dst, 0, src.Length);
 }
Example #3
0
 public static void Copy(T[] src, NativeArrayBurst <T> dst, int length) => NativeArrayBurst <T> .Copy(src, 0, dst, 0, length);