Refactor allocation types and improve memory management

This commit renames `AllocationType` to `AllocationOption` across multiple files, enhancing clarity in memory allocation practices. Key updates include:
- Modifications to the `UnsafeArray`, `ParallelNoiseBenchmark`, `Arena`, and `DynamicArena` classes to utilize the new `AllocationOption`.
- Refactoring of the `AllocationManager` and `HashMapHelper` classes to support the new allocation strategy.
- Removal of the `Misaki.HighPerformance.Mathematics` project reference, indicating a restructuring of dependencies.
- Introduction of a new `MathUtilities` class for calculating the smallest power of two, aiding memory allocation strategies.

These changes collectively improve code maintainability and clarity in memory management.
This commit is contained in:
Misaki
2025-04-03 12:06:25 +09:00
parent 48f2dce778
commit da64e07c6f
17 changed files with 111 additions and 71 deletions

View File

@@ -49,9 +49,9 @@ public unsafe struct UnsafeHashSet<T> : IUnsafeCollection<T>, IEnumerable<T>
public IEnumerator<T> GetEnumerator() => new Enumerator((HashMapHelper<T>*)UnsafeUtilities.AddressOf(ref _hashMap));
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
public UnsafeHashSet(int capacity)
public UnsafeHashSet(int capacity, Allocator allocator)
{
_hashMap = new HashMapHelper<T>(capacity, 0, HashMapHelper<T>.MINIMAL_CAPACITY);
_hashMap = new HashMapHelper<T>(capacity, 0, HashMapHelper<T>.MINIMAL_CAPACITY, allocator);
}
/// <summary>