Introduce VirtualArena for large, thread-safe virtual memory allocation and FreeList allocator for efficient persistent allocations. Update AllocationManager to support new allocators, add cross-platform virtual memory utilities, and improve thread-safety and performance in existing allocators. Bump version to 1.5.0 and update project configuration. BREAKING CHANGE: AllocationManager initialization now requires explicit parameters for arena and FreeList capacities. Existing allocator usage may require code changes.
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
namespace Misaki.HighPerformance.LowLevel.Buffer;
|
|
|
|
[Flags]
|
|
public enum AllocationOption : byte
|
|
{
|
|
/// <summary>
|
|
/// Default allocation option. Values are uninitialized.
|
|
/// </summary>
|
|
None = 0,
|
|
/// <summary>
|
|
/// Clear the memory to zero upon allocation.
|
|
/// </summary>
|
|
Clear = 1 << 0
|
|
}
|
|
|
|
public enum Allocator : byte
|
|
{
|
|
// Make the first allocator as invalid because we don't want to user create a default collection without passing any parameters
|
|
Invalid,
|
|
/// <summary>
|
|
/// Allocator for temporary allocations. Allocations are automatically released after use automatically.
|
|
/// </summary>
|
|
Temp,
|
|
/// <summary>
|
|
/// Allocator for persistent allocations. Allocations are not automatically released after use.
|
|
/// </summary>
|
|
Persistent,
|
|
/// <summary>
|
|
/// Allocator for persistent allocations using a free list. Allocations are not automatically released after use, but can be reused to reduce fragmentation and improve performance.
|
|
/// </summary>
|
|
FreeList
|
|
}
|