fitzgen / bumpalo

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

Fix chunk_capacity to return the remaining capacity, not the total #209

Closed msullivan closed 12 months ago

msullivan commented 12 months ago

chunk_capacity is documented as returning "the remaining capacity in the current chunk", but actually returns the total capacity for the current chunk.

(Arguably, the actual behavior is itself totally sensible, and this is a documentation bug, though in that case I would propose adding a new function that returns the remaining capacity. I would like it for debugging/measurement purposes.)