public void Recycle(ref NativeBufferArray <T> value) { if (value != null) { value.Dispose(); } }
public static void Recycle(ref NativeBufferArray <T> buffer) { if (buffer.isCreated == true) { buffer.Dispose(); } buffer = NativeBufferArray <T> .Empty; }
public static void RecycleWithIndex <T, TCopy>(ref NativeBufferArray <T> item, TCopy copy) where TCopy : IArrayElementCopyWithIndex <T> where T : struct { for (int i = 0; i < item.Length; ++i) { copy.Recycle(i, ref item.arr.GetRef(i)); } item = item.Dispose(); }
public static void Recycle <T, TCopy>(ref NativeBufferArray <T> item, TCopy copy) where TCopy : IArrayElementCopy <T> where T : struct { for (int i = 0; i < item.Length; ++i) { copy.Recycle(item.arr[i]); } item = item.Dispose(); }