fitzgen / bumpalo

A fast bump allocation arena for Rust
https://docs.rs/bumpalo
Apache License 2.0
1.39k stars 110 forks source link

Box for bumpalo #76

Closed zakarumych closed 4 years ago

zakarumych commented 4 years ago

Most of the code is a copy of Rust's alloc::boxed::Box. New type is behind feature "boxed".

Also adds Vec::into_boxed_slice and From<Vec<T>> for Box<[T]> when both "boxed" and "collections" features are enabled.

fitzgen commented 4 years ago

Hi! Thanks for this PR, I've wanted this for a while, but have never gotten around to it. I'll dig into the code in a little bit.

@jorendorff, I know that jsparagus has a similar thing, would merging this PR allow you to remove your bespoke Box and use this instead? (if not, why not?)

zakarumych commented 4 years ago

There's handy feature for doc generation available on nightly, which allows marking parts of API as feature-gated. Would you consider running doc-test on nightly? Otherwise I have to remove it.