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); }
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); }
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); }
public unsafe UnsafeEntityQueryDataPtrList(EntityQueryData **ptr, int length) { Ptr = null; Length = 0; Capacity = 0; Allocator = Allocator.Invalid; ListData = new UnsafePtrList((void **)ptr, length); }
public unsafe UnsafeArchetypePtrList(Archetype **ptr, int length) { Ptr = null; Length = 0; Capacity = 0; Allocator = Allocator.Invalid; ListData = new UnsafePtrList((void **)ptr, length); }