world timer supports numa and thread affinity binding

This commit is contained in:
Youmu Liu
2026-08-20 16:53:34 +08:00
parent 843eb6b237
commit 968a6afe1a
19 changed files with 223 additions and 88 deletions
@@ -40,19 +40,19 @@ namespace StgSharp.HighPerformance.Memory
_buffer = buffer;
_Capacity = count;
int initCount = count switch
_recycle = new((int)_Capacity);
_recycle.PushRange(init, (int)count);
_currentIndex = _Capacity;
static void init(
Span<nuint> arr,
int _
)
{
<= 4 => 4,
> 64 => 64,
_ => (int)count
};
Span<nuint> span = stackalloc nuint[initCount];
for (int i = 0; i < initCount; i++) {
span[i] = _buffer + ((nuint)(i * _elementSize));
for (int i = 0; i < arr.Length; i++) {
arr[i] = (nuint)i;
}
}
_recycle = CapacityFixedStackBuilder.Create(span);
_Capacity = count;
_currentIndex = (nuint)initCount;
}
public override nuint Allocate()