-
Notifications
You must be signed in to change notification settings - Fork 302
Add support for bumpalo #231
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
Conversation
src/raw/alloc.rs
Outdated
|
||
#[cfg(feature = "bumpalo")] | ||
unsafe impl Allocator for bumpalo::Bump { | ||
fn allocate(&self, layout: Layout) -> Result<NonNull<u8>, AllocError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, I'm comparing this with the implementation I made upstream, and the signature looks wrong.
allocator_api
signature should be NonNull<[u8]>
. That makes me require the nonnull_slice_from_raw_parts
feature.
It feels like I'm missing something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's just an internal Allocator
trait, it is completely private and can't be implemented outside this crate. As such, it doesn't have to match the standard library Allocator
trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha! I missed that, thank you!
@bors r+ |
📌 Commit 5467e3f has been approved by |
☀️ Test successful - checks-travis |
Allows
Bump
and&Bump
to be used as allocators without the nightly feature.This is currently blocked on fitzgen/bumpalo#92 for support on nightly.