-
Notifications
You must be signed in to change notification settings - Fork 5
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
Provide feature to use nightly allocator API #6
Comments
I'm not opposed to having this, under a feature (maybe |
I gave it a try today, and it seems like we need change on |
@vorner |
Nice :-). Do you want to give the PR a try? |
I think I'll try to add this :) |
Hmm, I don't think it would be possible to implement this in a way to have the allocator shared between threads since the collection must keep a reference to the allocator ( |
I wonder… the fact we don't remember the exact |
I checked, and |
I see. But it „leaks“ in all the other cases, so we could just leak every time. Honestly, just forwarding the feature is kind of… not really much useful. You can always just list both bumpalo and bumpalo-herd in the Cargo.toml, the former with the feature. |
I am also interested in being able to use a Member as an allocator for other collections, and #15 looked exactly what would be needed to be able to do that. Would someone be able to explain why that was closed? |
#15 (review) This was the reason. If you need Member as an allocator, you can just use Member::as_bump() |
Apologies for the previous comment being unclear, I didn't have a lot of time to spend on it. First of all, while I saw that comment previously, I'd missed the distinction between the Allocator being implemented for Herd vs Member. I saw Is there any reason brought up that |
This is how I perceive this issue:
But still, if you have an idea of how to approach this, I'll gladly review it! Please enlighten us :) |
In latest Rust nightly we can allocate with custom allocator (for example https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html#method.new_in).
It will be great for bumpalo-herd to provide the ability to use this. To achieve this, we need to implement
std::alloc::AllocRef
.See also fitzgen/bumpalo#87.
The text was updated successfully, but these errors were encountered: