Enhance memory management and data structures

Updated `CollectionBenchmark` for setup/cleanup methods,
streamlined benchmarking in `Program.cs`, and improved
documentation in `AllocationOption` and `Allocator` enums.
Made `Enumerator` structs public in several collections
and clarified constructor parameters. Introduced a new
`UnsafeStack` struct for stack operations. Enhanced
`AllocationManager` with better memory tracking and
management, ensuring proper allocation and disposal.
This commit is contained in:
Misaki
2025-04-03 15:47:43 +09:00
parent da64e07c6f
commit 1e00f4eb25
10 changed files with 232 additions and 78 deletions

View File

@@ -2,14 +2,32 @@
public enum AllocationOption : byte
{
/// <summary>
/// Allocator for uninitialized memory
/// </summary>
UnInitialized,
Clear
/// <summary>
/// Allocator for initialized memory.
/// </summary>
Clear,
/// <summary>
/// Allocator for untracked memory.
/// Use this option carefully, as the allocation manager will not track the memory.
/// No warning will be given if the memory is not freed.
/// </summary>
UnTracked
}
public enum Allocator: byte
public enum Allocator : byte
{
// Make the first allocator as invalid because we don't want to user create a defualt collection without passing any parameters
Invalid = 0,
Temp = 1,
Persistent = 2,
Invalid,
/// <summary>
/// Allocator for temporary allocations. Allocations are cleared after use.
/// </summary>
Temp,
/// <summary>
/// Allocator for persistent allocations. Allocations are not cleared after use.
/// </summary>
Persistent,
}