public void Alloc(uint size, Allocator nativeAllocator) { MB <T> b = new MB <T>(); b.Set(new T[size]); this._realBuffer = b; _buffer = null; }
public void Alloc(uint size) { MB <T> b = new MB <T>(); b.Set(new T[size], size); buffer = b; this.realBuffer = b; }
public void Resize(uint newCapacity) { DBC.Common.Check.Require(newCapacity > 0, "Resize requires a size greater than 0"); var realBuffer = _realBuffer.ToManagedArray(); Array.Resize(ref realBuffer, (int)newCapacity); MB <T> b = new MB <T>(); b.Set(realBuffer); this._realBuffer = b; _buffer = null; }
public void Resize(uint size) { DBC.Common.Check.Require(size > 0, "Resize requires a size greater than 0"); var realBuffer = buffer.ToManagedArray(out _); Array.Resize(ref realBuffer, (int)size); MB <T> b = new MB <T>(); b.Set(realBuffer, size); buffer = b; this.realBuffer = b; }
public void Resize(uint newCapacity, bool copyContent = true) { DBC.Common.Check.Require(newCapacity >= 0, "Resize requires a size greater or equal to 0"); var realBuffer = _realBuffer.ToManagedArray(); if (copyContent == true) { Array.Resize(ref realBuffer, (int)newCapacity); } else { realBuffer = new T[newCapacity]; } MB <T> b = new MB <T>(); b.Set(realBuffer); this._realBuffer = b; _buffer = null; }