Refactor TLSFAllocator locking, update AddRange signatures
Refactored TLSFAllocator to use a static lock instead of per-instance GCHandle-based locking, removing the Dispose method and related code. Updated allocation methods to use the static lock for thread safety. Removed Dispose call on s_pTLSFAllocator. In UnsafeChunkedList, removed an unused using directive and replaced explicit int types with var in AddRange. Changed UnsafeList<T>.AddRange to accept ReadOnlySpan<T> for broader compatibility. Bumped assembly version to 1.6.25.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||
using Misaki.HighPerformance.LowLevel.Collections.Contracts;
|
||||
using Misaki.HighPerformance.LowLevel.Utilities;
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -148,9 +147,9 @@ public unsafe struct UnsafeChunkedList<T> : IUnsafeCollection<T>
|
||||
|
||||
fixed (T* pCollection = collection)
|
||||
{
|
||||
int remaining = count;
|
||||
var remaining = count;
|
||||
T* srcPtr = pCollection;
|
||||
int currentIndex = index;
|
||||
var currentIndex = index;
|
||||
|
||||
while (remaining > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user