hlsf wrong slicing solving
This commit is contained in:
@@ -36,36 +36,31 @@ using Allocator = StgSharp.HighPerformance.Memory.HybridLayerSegregatedFitAlloca
|
||||
|
||||
namespace StgSharp.HighPerformance.Memory
|
||||
{
|
||||
public unsafe struct HybridLayerSegregatedFitAllocationHandle
|
||||
public readonly unsafe struct HybridLayerSegregatedFitAllocationHandle
|
||||
{
|
||||
|
||||
internal readonly byte* BufferPointer;
|
||||
internal readonly Allocator.Entry* EntryHandle;
|
||||
public readonly uint AllocSize;
|
||||
|
||||
internal HybridLayerSegregatedFitAllocationHandle(Allocator.Entry* handle, uint s)
|
||||
{
|
||||
EntryHandle = handle;
|
||||
BufferPointer = (byte*)handle->Position;
|
||||
Pointer = (byte*)handle->Position;
|
||||
AllocSize = s;
|
||||
}
|
||||
|
||||
public readonly ref byte this[int index]
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => ref BufferPointer[index];
|
||||
get => ref Pointer[index];
|
||||
}
|
||||
|
||||
public readonly byte* Pointer
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => BufferPointer;
|
||||
}
|
||||
public readonly byte* Pointer { get; init; }
|
||||
|
||||
public readonly Span<byte> BufferHandle
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => new((byte*) EntryHandle->Position, (int)AllocSize);
|
||||
get => new(Pointer, (int)AllocSize);
|
||||
}
|
||||
|
||||
public readonly Enumerator GetEnumerator()
|
||||
|
||||
Reference in New Issue
Block a user