Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryPool: Add unmanaged versions #23234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Justus2308
Copy link
Contributor

@Justus2308 Justus2308 commented Mar 13, 2025

The memory pool takes a special place among the Zig std allocators since it is the only one that doesn't expose an Allocator interface.

Because it doesn't have to adhere to the Allocator interface (which doesn't take an explicit child allocator) the memory pool is free to take an allocator as a parameter for its functions and it makes sense to me that there should be an unmanaged version.

This is also in accordance with Zig's stated goal to embrace unmanaged-style containers by 0.15.0.

This pull request adds MemoryPoolUnmanaged, MemoryPoolAlignedUnmanaged, MemoryPoolExtraUnmanaged and the corresponding ...WithAllocator variants, to which the old types now alias.
MemoryPoolError has also been replaced with Allocator.Error since it's the same anyways.

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.

1 participant