Skip to content

Commit eeec6e9

Browse files
Simnclaude
andauthored
Reset LocalAllocator when returning it to the pool (#1435)
* Reset pooled LocalAllocator when attaching a thread Between GetPooledAllocator and AddLocal, the allocator is neither pooled nor registered, so a collection in that window does not reset it. The thread then allocates from holes that the collection may have handed out again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Reset LocalAllocator when returning it to the pool Pooled allocators now never hold holes, instead of resetting them when a thread attaches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 73c4c8b commit eeec6e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/hx/gc/Immix.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,6 +3154,9 @@ class GlobalAllocator
31543154
{
31553155
if (!mLocalPool[p])
31563156
{
3157+
// Pooled allocators hold no holes. Between GetPooledAllocator and AddLocal an allocator
3158+
// is neither pooled nor registered, so a collection in that window would not reset it.
3159+
ClearPooledAlloc(inAlloc);
31573160
mLocalPool[p] = inAlloc;
31583161
return true;
31593162
}

0 commit comments

Comments
 (0)