working on L4's tlsf
This commit is contained in:
@@ -87,10 +87,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
int id
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
/*
|
||||
Tlsf* entry = (Tlsf*)(_entryManager._basePtr + id);
|
||||
_bufferAllocator.Free(entry);
|
||||
_bufferAllocator.Free(id);
|
||||
/**/
|
||||
}
|
||||
|
||||
@@ -100,7 +97,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
Span<IL4Predict> predictorSpan
|
||||
)
|
||||
{
|
||||
CacheLineHead* head = &_head[index];
|
||||
CacheLineMetadata* head = &_head[index];
|
||||
if (Interlocked.CompareExchange(ref head->RefCount, int.MinValue, 0) == 0)
|
||||
{
|
||||
// EvictLine(i + index);
|
||||
@@ -108,7 +105,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
int id = head->Predictor;
|
||||
IL4Predict predict = predictorSpan[id] ??
|
||||
throw new L4PredictUnregisteredException(id);
|
||||
predict.WriteBack(head->Origin, head->Profile, new ReadOnlySpan<byte>((byte*)(ulong)head->Address, (int)(ulong)head->Size));
|
||||
predict.WriteBack(head->Origin, head->Profile, new ReadOnlySpan<byte>((byte*)(ulong)head->Position, (int)(ulong)head->SizeForAllocator));
|
||||
RecycleLine(index);
|
||||
(*_mapCount)[index] = 0;
|
||||
(*_predictCount)[index] = int.MaxValue;
|
||||
|
||||
Reference in New Issue
Block a user