fitzgen / bumpalo

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

Provide an `alloc_extend` method #4

Closed ennis closed 4 years ago

ennis commented 5 years ago

It would be great if Bump could provide an alloc_extend method to allocate values from an iterator and return a slice (similarly to TypedArena::alloc_extend). Something in the lines of:

pub fn alloc_extend<T, I>(&self, iterable: I) -> &mut [T] where
    T: BumpAllocSafe,
    I: IntoIterator<Item = T>, 
fitzgen commented 4 years ago

We have alloc_slice_fill_iter and various other alloc_slice_* methods now, so I think we can close this. If not, please open a new issue with specifics!