before rewrite of HLSF

This commit is contained in:
Youmu Liu
2026-05-07 11:16:41 +08:00
parent e636410ba6
commit c343e763ed
4 changed files with 34 additions and 99 deletions
@@ -39,7 +39,7 @@ namespace StgSharp.HighPerformance.Memory
nuint size
)
{
if (size > _maxSize) {
if (size > _maxAllocSize) {
throw new InvalidOperationException("Requested size exceeds maximum allocatable size.");
}
@@ -89,7 +89,7 @@ namespace StgSharp.HighPerformance.Memory
out HlsfHandle handle
)
{
if (size > _maxSize)
if (size > _maxAllocSize)
{
handle = default;
return false;
@@ -47,7 +47,7 @@ namespace StgSharp.HighPerformance.Memory
private readonly Action<nuint> _freeHandle;
private bool disposedValue;
private readonly int _align;
private readonly nuint _maxSize;
private readonly nuint _maxAllocSize;
private readonly nuint _size;
private readonly SlabAllocator<Entry> _entries;
@@ -98,7 +98,7 @@ namespace StgSharp.HighPerformance.Memory
size *= 4;
_levelSizeArray[i] = size;
}
_maxSize = maxBlockSize;
_maxAllocSize = maxBlockSize;
_freeHandle = freeHandle ?? (static _ => { });
}