HLSf use nuint rather than long, L4 now uses hlsf rather than array to alloc cache line.

This commit is contained in:
Youmu Liu
2026-04-21 20:32:28 +08:00
parent 2e2d64a2ce
commit 4f3e206dcb
11 changed files with 151 additions and 133 deletions
+2 -2
View File
@@ -51,13 +51,13 @@ namespace StgSharp
}
public bool Predict(
Span<CacheLinePrediction> node,
Span<CacheLineDescription> node,
out int count
)
{
count = Math.Min(_addresses.Length, node.Length);
for (int i = 0; i < count; i++) {
node[i] = new CacheLinePrediction
node[i] = new CacheLineDescription
{
Address = _addresses[i],
MapPolicy = 0,
+5 -5
View File
@@ -56,13 +56,13 @@ namespace StgSharp
}
public bool Predict(
Span<CacheLinePrediction> node,
Span<CacheLineDescription> node,
out int count
)
{
count = Math.Min(_addresses.Length, node.Length);
for (int i = 0; i < count; i++) {
node[i] = new CacheLinePrediction
node[i] = new CacheLineDescription
{
Address = _addresses[i],
MapPolicy = 0,
@@ -308,7 +308,7 @@ namespace StgSharp
}
L4Assert(
evictedOrigin != nuint.Zero,
$"{$"WriteBack origin should be a batch1 address, "}{($"WriteBackLog=[{string.Join(", ", predictor2.WriteBackLog)}]")}");
$"{$"WriteBack origin should be a batch1 address, "}{$"WriteBackLog=[{string.Join(", ", predictor2.WriteBackLog)}]"}");
// 断言 c: SwissTable 中已不含该 origin
L4Assert(
@@ -323,11 +323,11 @@ namespace StgSharp
remapped.Dispose();
L4Assert(
refill == 0xCC,
$"{$"Re-mapped evicted line should be re-prefetched with 0xCC, "}{($"got 0x{refill:X2} (0xAA = stale data not evicted)")}");
$"{$"Re-mapped evicted line should be re-prefetched with 0xCC, "}{$"got 0x{refill:X2} (0xAA = stale data not evicted)"}");
if (_l4FailCount == 0) {
Console.WriteLine(
$"{($"PASS (evicted 0x{evictedOrigin:X}, remain={remain}, ")}{$"WriteBack×{predictor2.WriteBackLog.Count})"}");
$"{$"PASS (evicted 0x{evictedOrigin:X}, remain={remain}, "}{$"WriteBack×{predictor2.WriteBackLog.Count})"}");
}
}
catch (Exception ex)
+2 -2
View File
@@ -58,14 +58,14 @@ namespace StgSharp
}
public bool Predict(
Span<CacheLinePrediction> node,
Span<CacheLineDescription> node,
out int count
)
{
PredictCallCount++;
count = Math.Min(_addresses.Length, node.Length);
for (int i = 0; i < count; i++) {
node[i] = new CacheLinePrediction
node[i] = new CacheLineDescription
{
Address = _addresses[i],
MapPolicy = 0,