HLSf use nuint rather than long, L4 now uses hlsf rather than array to alloc cache line.
This commit is contained in:
@@ -46,20 +46,20 @@ namespace StgSharp.HighPerformance.Memory
|
||||
private int _maxUnused;
|
||||
private int _recycleCount;
|
||||
|
||||
internal readonly Hlsf.Entry* _basePtr;
|
||||
internal readonly CacheLineHead* _basePtr;
|
||||
internal readonly int* _indexReuse;
|
||||
|
||||
public Slab(
|
||||
nuint ptr
|
||||
)
|
||||
{
|
||||
_basePtr = (Hlsf.Entry*)ptr;
|
||||
_basePtr = (CacheLineHead*)ptr;
|
||||
_indexReuse = (int*)(_basePtr + Capacity);
|
||||
_maxUnused = 0;
|
||||
_recycleCount = 0;
|
||||
}
|
||||
|
||||
public static nuint RequestedAllocation { get; } = ((nuint)(Unsafe.SizeOf<Hlsf.Entry>() + sizeof(int))) * Capacity;
|
||||
public static nuint RequestedAllocation { get; } = ((nuint)(Unsafe.SizeOf<CacheLineHead>() + sizeof(int))) * Capacity;
|
||||
|
||||
public override nuint Allocate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user