Skip to content

Add support for the nightly unstable allocator API #656

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

Closed

Conversation

dylanplecki
Copy link

Fixes #653.

Adds a new, optional feature to the bytes crate to enable support for the Rust nightly unstable allocator_api feature (docs).

This feature is disabled by default and will only work on Rust nightly for now.

When enabled, this feature changes the default implementations of Buf and BufMut on Box<u8>, Vec<u8>, and VecDeque<u8> to support an optional second generic argument for an Allocator type. This Allocator controls how the type manages memory on the heap. No code paths are changed in the crate, only a new generic argument is provided to these types.

When disabled, this feature incurs no changes to the crate and does not change the API or any code paths.

@dylanplecki
Copy link
Author

Closing due to the use of the unstable Rust feature allocator_api, see #653. This PR can be reattempted upon stabilization of the feature.

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.

Feature Request: Default implementations for heap types which support the unstable allocator API
1 participant