public unsafe void Dispose() { if (_queue != null) { _queue->Dispose(); _queue = null; } }
public NativeBag(Allocator allocator) { unsafe { var sizeOf = MemoryUtilities.SizeOf <UnsafeBlob>(); var listData = (UnsafeBlob *)MemoryUtilities.Alloc((uint)sizeOf, allocator); //clear to nullify the pointers MemoryUtilities.MemClear((IntPtr)listData, (uint)sizeOf); listData->allocator = allocator; _queue = listData; } }