Update memory management and collection structures
Added `AllocationHandler` struct for memory allocation management. Added `UnsafeArrayPool` class for pooling `UnsafeArray<T>` instances. Added new `External` option to `Allocator` enum. Added default constructors for `UnsafeList`, `UnsafeQueue`, and `UnsafeStack` using `Persistent` allocator. Changed namespace in `AllocationManager` to `Misaki.HighPerformance.Unsafe.Buffer`. Changed `MemoryLeakException` to use `MemoryLeakExceptionInfo` for better debugging. Changed constructor behavior in `UnsafeArray` to clarify memory management responsibilities. Changed `MemoryUtilities` to include null checks in `Free` and `AlignedFree` methods. Removed unused using directive in `CollectionBenchmark.cs`. Removed initialization of `AllocationManager` in `Program.cs`.
This commit is contained in:
@@ -79,6 +79,10 @@ public unsafe struct UnsafeQueue<T> : IUnsafeCollection<T>
|
||||
public IEnumerator<T> GetEnumerator() => new Enumerator((UnsafeQueue<T>*)UnsafeUtilities.AddressOf(ref this));
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
public UnsafeQueue() : this(1, Allocator.Persistent)
|
||||
{
|
||||
}
|
||||
|
||||
public UnsafeQueue(int capacity, Allocator allocator, AllocationOption allocationType = AllocationOption.None)
|
||||
{
|
||||
_array = new UnsafeArray<T>(capacity, allocator, allocationType);
|
||||
|
||||
Reference in New Issue
Block a user