working on L4's tlsf
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user