fitzgen / bumpalo

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

try_* variants for slices #175

Open stijnfrishert opened 2 years ago

stijnfrishert commented 2 years ago

Looking at the interface, I'm missing:

Need try_alloc_slice_fill_copy() and try_alloc_slice_fill_default() myself, though why not add all while we're at it?

Is there a specific reason these weren't added?

stijnfrishert commented 2 years ago

Ah, turns out try_* is for actual OS OOM, not the capacity given to Bump::with_capacity().

In that case I'm ok without these functions, but leaving the issue open for others.