hlsf wrong slicing solving
This commit is contained in:
@@ -47,12 +47,18 @@ namespace StgSharp.HighPerformance.Memory
|
||||
EntryHandle = handle;
|
||||
Pointer = (byte*)handle->Position;
|
||||
AllocSize = s;
|
||||
|
||||
// Console.WriteLine($"{(ulong)handle->PreviousNear}<->{(ulong)handle->NextNear},\t{handle->Size}");
|
||||
}
|
||||
|
||||
public readonly ref byte this[int index]
|
||||
public readonly ref byte this[uint index]
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => ref Pointer[index];
|
||||
get
|
||||
{
|
||||
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual<uint>(index, AllocSize);
|
||||
return ref Pointer[index];
|
||||
}
|
||||
}
|
||||
|
||||
public readonly byte* Pointer { get; init; }
|
||||
@@ -73,7 +79,7 @@ namespace StgSharp.HighPerformance.Memory
|
||||
|
||||
private HybridLayerSegregatedFitAllocationHandle _handle;
|
||||
|
||||
private int _index = -1;
|
||||
private uint _index = ~0u;
|
||||
|
||||
internal Enumerator(HybridLayerSegregatedFitAllocationHandle span)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user