working on L4's tlsf

This commit is contained in:
Youmu Liu
2026-05-13 20:13:37 +08:00
parent ae57de4040
commit c9fb11b47b
8 changed files with 600 additions and 141 deletions
@@ -117,24 +117,5 @@ namespace StgSharp.HighPerformance.Memory
return false;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private unsafe bool TryGetEmptyLine(
nuint size,
out int index
)
{
if (!_bufferAllocator.TryAlloc(size, out Tlsf.Handle handle))
{
index = 0;
return false;
}
// origin :CacheLineHead* entry = (CacheLineHead*)handle.EntryHandle;
CacheLineHead* entry = (CacheLineHead*)handle.Address;
index = entry->Id;
return true;
}
}
}