Example #1
0
        public void Dispose()
        {
            for (var i = 0; i != SystemData->Length; i++)
            {
                UnsafeUtility.Free(SystemData->Ptr[i], Allocator.Persistent);
            }

            UnsafePtrList.Destroy(SystemData);
        }
        public BlockAllocator(AllocatorManager.AllocatorHandle handle, int budgetInBytes)
        {
            m_handle         = handle;
            m_nextByteOffset = 0;
            var blocks = (budgetInBytes + ms_BlockSize - 1) >> ms_Log2BlockSize;

            m_blocks      = new UnsafePtrList(blocks, handle);
            m_allocations = new UnsafeIntList(blocks, handle);
        }
Example #3
0
 public void Allocate()
 {
     SystemData = UnsafePtrList.Create(256, Allocator.Persistent, NativeArrayOptions.ClearMemory);
 }
 /// <summary>
 /// Adds elements from a list to this list.
 /// </summary>
 /// <param name="list">Other container to copy elements from.</param>
 /// <remarks>
 /// If the list has reached its current capacity, internal array won't be resized, and exception will be thrown.
 /// </remarks>
 public void AddRangeNoResize(UnsafePtrList list)
 {
     ListData->AddRangeNoResize <IntPtr>(list.Ptr, list.Length);
 }
Example #5
0
 public unsafe UnsafeEntityQueryDataPtrList(int initialCapacity, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.UninitializedMemory)
 {
     Ptr = null; Length = 0; Capacity = 0; Allocator = Allocator.Invalid; ListData = new UnsafePtrList(initialCapacity, allocator, options);
 }
Example #6
0
 public unsafe UnsafeEntityQueryDataPtrList(EntityQueryData **ptr, int length)
 {
     Ptr = null; Length = 0; Capacity = 0; Allocator = Allocator.Invalid; ListData = new UnsafePtrList((void **)ptr, length);
 }
Example #7
0
 public unsafe UnsafeArchetypePtrList(Archetype **ptr, int length)
 {
     Ptr = null; Length = 0; Capacity = 0; Allocator = Allocator.Invalid; ListData = new UnsafePtrList((void **)ptr, length);
 }