-
Notifications
You must be signed in to change notification settings - Fork 302
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
Support for custom allocators/ref counting #269
Comments
I have made the PoC API simpler and more flexible. |
Custom ref counting would most likely require another type parameter. To be honest I think non-global allocator might over-complicated for 99% of users. But if we want it, I think it might be better to wait for We shouldn't come up with own allocator traits and instead use something common. I think having global allocator support as first step would be good start and we already have PR for this |
Something allowing this was added in #298. |
Allocation and reference counting of the buffers could be abstracted behind a generic type parameter. This can enable:
no_std
configurations with a custom allocator.Here's a sketch of a possible abstraction API:
Bytes
andBytesMut
could then be parameterized with aBufHandle
implementation in a backward-compatible way:Thread safety shall then depend on the choice of the allocator:
The text was updated successfully, but these errors were encountered: