add scheduler method; fixing buffer parallel errors

This commit is contained in:
Youmu Liu
2025-11-19 18:09:25 +08:00
parent 45d1d08af8
commit 04fc55d31e
11 changed files with 272 additions and 339 deletions
@@ -93,7 +93,8 @@ namespace StgSharp.Collections
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public T[] PopRange(int count)
{
int i = int.Min(count, _index) - 1;
int i = int.Min(count, _index);
_index -= i;
return _values[0..i];
}
@@ -147,8 +148,7 @@ namespace StgSharp.Collections
public static CapacityFixedStack<T> Create<T>(ReadOnlySpan<T> values)
{
CapacityFixedStack<T> stack = new(values.Length);
Span<T> sp = stack.GetValueLayout();
values.CopyTo(sp);
stack.PushRange(values);
return stack;
}