Closed EliaGeretto closed 3 months ago
Could you please tell me if you would be willing to merge this and, in that case, provide some comments?
Thanks for making this pull request and giving us an idea of what changes are required to support generic backing allocators in bumpalo
.
Could you please tell me if you would be willing to merge this and, in that case, provide some comments?
Unlike implementing the allocator API, this support for being parameterized by an allocator is rather invasive with all those cfg
s. Therefore, I'd prefer to wait until the allocator API stabilizes -- and bumpalo
can always be parameterized by an allocator, rather than only being parameterized in some build configurations -- before adding this support.
I can understand. I need this for my own project, so I am planning to keep my branch reasonably up-to-date. I will leave the PR here in case someone else needs this functionality.
I am not sure why, but to compile correctly my code requires at least Rust 1.48.
Closing old pull requests.
This pull requests adds support for specifying a custom allocator that
Bump
should use to allocate new chunks. This should provide a reasonable interface for situations in which memory should not be retrieved from theGlobal
allocator and swapping the whole allocator using#[global_allocator]
is not possible.I have taken care to make this compile both with nightly and stable Rust, albeit some nasty generics workarounds were necessary.
This PR should, ideally, solve #100.