working on L4's tlsf
This commit is contained in:
@@ -74,13 +74,13 @@ namespace StgSharp.HighPerformance.Memory
|
||||
// now prefetch the misses
|
||||
for (int i = 0; i < missIndex; i++)
|
||||
{
|
||||
CacheLineHead* head;
|
||||
CacheLineMetadata* head;
|
||||
ref CacheLineDescription pHandle = ref span[i];
|
||||
nuint address = pHandle.Address;
|
||||
int index;
|
||||
if (_map.TryGet(address, out nuint handle))
|
||||
{
|
||||
head = (CacheLineHead*)handle;
|
||||
head = (CacheLineMetadata*)handle;
|
||||
index = head->Id;
|
||||
(*_predictCount)[index] = 0; // reset eviction counter
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
(*_mapCount)[index] = 1;
|
||||
|
||||
// pre fetch them here
|
||||
predict.Prefetch(head->Origin, head->Profile, new Span<byte>((byte*)(ulong)head->Address, (int)(ulong)head->Size));
|
||||
predict.Prefetch(head->Origin, head->Profile, new Span<byte>((byte*)(ulong)head->Address, (int)(ulong)head->SizeForAllocator));
|
||||
_ = _map.TryAddOrSet(address, (nuint)head, out _);
|
||||
}
|
||||
_ = Interlocked.Add(ref _aheadCount, actualCount);
|
||||
|
||||
Reference in New Issue
Block a user