fitzgen / bumpalo

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

allocator_api: provide a grow_zeroed implementation #99

Closed baloo closed 3 years ago

baloo commented 3 years ago

Fixup #98

The current implementation of grow_zeroed in liballoc allocates a new chunk, copies data over, then deallocates the old chunk. Bumpalo can use a more memory efficient version of that, and this is an implementation of it.

baloo commented 3 years ago

(there is some noise due to rustfmt, which I forgot to run in the initial implementation, let me know if you want me to drop it).