fitzgen / bumpalo

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

allocator_api: missing grow_zeroed implementation #98

Closed baloo closed 3 years ago

baloo commented 3 years ago

I believe the implementation made in https://github.com/fitzgen/bumpalo/pull/92 could use a specific grow_zeroed implementation

If I read https://github.com/rust-lang/rust/blob/ee88f46bb5e27c4d9f30326e69ff2298dcbeecb1/library/core/src/alloc/mod.rs#L253-L277 correctly, that could use more effective one. As currently implemented, it grows by new_layout.size() where it could grow by only new_layout.size()-old_layout.size().