/// <summary> /// Create a new BatchAllocator /// </summary> /// <param name="allocator">The backing native allocator to be used</param> public BatchAllocator(Allocator allocator) { m_Allocator = allocator; m_Allocations = new GrowableBuffer <Allocation>(Allocator.TempJob); m_TotalSize = 0; m_CurrentOffset = 0; m_LargestAlignment = 0; AllocationRoot = null; }
/// <summary> /// Create a new GrowableBuffer /// </summary> /// <param name="allocator">The native allocator to use</param> /// <param name="source">A source buffer to copy</param> public GrowableBuffer(Allocator allocator, GrowableBuffer <T> source) : this(allocator, source.Count) { UnsafeUtility.MemCpy(*m_Array, *source.m_Array, source.Count * UnsafeUtility.SizeOf <T>()); *m_Count = source.Count; }
public bool Equals(GrowableBuffer <T> other) { return(m_Array == other.m_Array); }