fitzgen / bumpalo

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

allocated_bytes_with_headers function #184

Closed stepancheg closed 1 year ago

stepancheg commented 1 year ago

We are implementing memory profiler, and for such profiler we need to know allocation overhead as precise as possible (especially for small bumps where header size overhead might be significant).

allocated_bytes function does not include header size.

So add allocated_bytes_with_headers which returns the amount of memory requested from rust allocator.

stepancheg commented 1 year ago

Applied the suggestions.

stepancheg commented 1 year ago

No problem! Added quickcheck test.

fitzgen commented 1 year ago

Looks like MIRI tests are failing in CI. I suspect this is due to a change in MIRI and existing code here, but I don't have the time to investigate at the moment.

fitzgen commented 1 year ago

Thanks!