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`.
13 lines
426 B
C#
13 lines
426 B
C#
namespace Misaki.HighPerformance.Unsafe.Collections.Contracts;
|
|
|
|
internal unsafe interface IAllocator : IDisposable
|
|
{
|
|
public T* Allocate<T>(uint size, uint alignSize, AllocationOption allocationOption)
|
|
where T : unmanaged;
|
|
|
|
public T* Reallocate<T>(T* buffer, uint size, uint alignSize)
|
|
where T : unmanaged;
|
|
|
|
public void Free<T>(T* buffer, uint size, uint alignSize)
|
|
where T : unmanaged;
|
|
} |