fitzgen / bumpalo

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

Add `iter_allocated_chunks_raw()` #127

Closed poconn closed 2 years ago

poconn commented 2 years ago

Adds iter_allocated_chunks_raw(), which (a) yields raw (*mut u8, usize), and (b) only borrows the arena immutably.

Fixes #121, follow-up from PR https://github.com/fitzgen/bumpalo/pull/126 (posting a new one as all of the previous changes would be reverted)

I need to finish the docs and add tests, posting just to get confirmation on this approach first.

Thanks!

poconn commented 2 years ago

Added smoke tests. No unit tests, but hopefully the existing iter_allocated_chunks() test cases along with the added chunks_and_raw_chunks_are_same() provide sufficient coverage? (especially considering that the old method now just wraps iter_allocated_chunks_raw())

poconn commented 2 years ago

Thanks @fitzgen! If it's not too much trouble, we'd really appreciate if you could release a new version with the changes, please? :) (no hurry if you have other pending changes, just whenever is convenient)

fitzgen commented 2 years ago

Published!

poconn commented 2 years ago

Great, thanks a lot!