Skip to content

Refactor and fix ObjectPool<T> - #146

Merged
marchc1 merged 4 commits into
SourceDotNET:mainfrom
ZehMatt:fix-objectpool
Oct 8, 2026
Merged

marchc1 merged 4 commits into
SourceDotNET:mainfrom
ZehMatt:fix-objectpool

Conversation

@ZehMatt

@ZehMatt ZehMatt commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

The old one had a race condition, two threads could be looking at the same freed slot and take it, the new version simply has a free list using ConcurrentBag and I got rid of IsMemoryPoolAllocated, nothing allocates those outside of the pool.

@marchc1
marchc1 merged commit e965a01 into SourceDotNET:main Oct 8, 2026
4 checks passed
@ZehMatt
ZehMatt deleted the fix-objectpool branch October 8, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants