HLSF done, working on matrix

This commit is contained in:
Nitload
2025-08-25 09:04:19 +08:00
parent 8779d7d77c
commit bd0e31e922
11 changed files with 78 additions and 549 deletions
@@ -32,12 +32,9 @@ using StgSharp.Threading;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace StgSharp.HighPerformance.Memory
{
@@ -45,8 +42,8 @@ namespace StgSharp.HighPerformance.Memory
{
private readonly BufferExpansionLock _lock = new();
private ConcurrentStackBuffer<nuint> _buffers;
private ConcurrentStackBuffer<nuint> _recycle;
private BufferStack<nuint> _buffers;
private BufferStack<nuint> _recycle;
private readonly int _elementSize = Unsafe.SizeOf<T>();
private nuint _currentBuffer;
@@ -67,7 +64,7 @@ namespace StgSharp.HighPerformance.Memory
span[i] = _currentBuffer + (nuint)(i * _elementSize);
}
_buffers = new(4);
_recycle = new(span);
_recycle = BufferStackBuilder.Create(span);
_currentCapacity = count;
_currentIndex = (nuint)initCount;
}