world timer supports numa and thread affinity binding
This commit is contained in:
@@ -6,9 +6,11 @@
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading;
|
||||
|
||||
namespace StgSharp.Collections
|
||||
@@ -122,6 +124,24 @@ namespace StgSharp.Collections
|
||||
_index += span.Length;
|
||||
}
|
||||
|
||||
public void PushRange(
|
||||
SpanAction<T, int> filling,
|
||||
int count
|
||||
)
|
||||
{
|
||||
if (count == 0) {
|
||||
return;
|
||||
}
|
||||
if (_index + count > _values.Length) {
|
||||
throw new InvalidOperationException("Not enough space in the stack to push the entire span.");
|
||||
}
|
||||
if (filling is not null)
|
||||
{
|
||||
filling(_values.AsSpan()[_index..(_index + count)], count);
|
||||
_index += count;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryPop(
|
||||
out T value
|
||||
)
|
||||
@@ -163,4 +183,4 @@ namespace StgSharp.Collections
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user