예제 #1
0
 public unsafe void Dispose()
 {
     if (_queue != null)
     {
         _queue->Dispose();
         _queue = null;
     }
 }
예제 #2
0
        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;
            }
        }