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
@@ -382,7 +382,7 @@ namespace StgSharp.HighPerformance.Memory
{
[FieldOffset(0)] internal readonly Metadata* _meta;
[FieldOffset(8)] public readonly void* Address;
[FieldOffset(8)] public readonly Ptr64 Address;
[FieldOffset(16)] public readonly Ptr64 Size;
internal Handle(
@@ -391,7 +391,7 @@ namespace StgSharp.HighPerformance.Memory
)
{
_meta = meta;
Address = (void*)(ulong)meta->Position;
Address = (ulong)meta->Position;
Size = meta->Size;
}
@@ -400,13 +400,13 @@ namespace StgSharp.HighPerformance.Memory
public ref byte this[
int offset
] => ref ((byte*)Address)[offset];
] => ref ((byte*)(ulong)Address)[offset];
public Span<byte> AsSpan(
int range = -1
)
{
return new Span<byte>(Address, range < 0 ? (int)(ulong)Size : range);
return new Span<byte>((byte*)(ulong)Address, range < 0 ? (int)(ulong)Size : range);
}
}