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

Can we have custom allocators in C? #66

Open
iboB opened this issue Mar 23, 2023 · 1 comment
Open

Can we have custom allocators in C? #66

iboB opened this issue Mar 23, 2023 · 1 comment
Labels
capi C-specific issue

Comments

@iboB
Copy link
Owner

iboB commented Mar 23, 2023

Mixin allocators are allowed, but all others, the ones that are std::pmr::polymorphic_allocator in C++, are not. C code uses the default allocation for all of them.
Moreover since objects and mutations are fully wrapped to expose to C, every instance of an object or an allocation leads to new/delete.

The question is: can we solve one or both of these problems by allowing allocator customization from C?

@iboB iboB added the question label Mar 23, 2023
@iboB
Copy link
Owner Author

iboB commented Apr 16, 2023

The key is to port not the allocator, but memory resource

@iboB iboB added capi C-specific issue and removed question labels Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
capi C-specific issue
Projects
None yet
Development

No branches or pull requests

1 participant