fix(freelist): fixed the memory leak issue of freelist

This commit is contained in:
2026-05-06 19:30:27 +09:00
parent d3e497c7d8
commit 264d96ef96
3 changed files with 40 additions and 40 deletions

View File

@@ -621,11 +621,6 @@ public unsafe struct FreeList : IMemoryAllocator<FreeList, FreeList.CreationOpti
}
var blockStartPtr = header->blockStart;
var chunk = header->ownerChunk;
if (chunk == null)
{
return;
}
var targetCache = header->ownerCache;
var bucketIndex = header->bucketIndex;
@@ -640,6 +635,11 @@ public unsafe struct FreeList : IMemoryAllocator<FreeList, FreeList.CreationOpti
}
var sameThread = t_ownerId == _instanceId && t_localCache == targetCache;
var chunk = header->ownerChunk;
if (chunk == null)
{
return;
}
if (sameThread)
{