Gets the remaining capacity in the current chunk (in bytes).
However:
#[test]
fn test_chunk_capacity() {
let alloc = bumpalo::Bump::with_capacity(1 << 15);
assert_eq!(alloc.chunk_capacity(), 36800);
// Allocation which fits within the current chunk.
alloc.alloc_str("hello world");
// Expect chunk capacity is lower than before, because of the allocation.
assert_ne!(alloc.chunk_capacity(), 36800);
}
Actual output as of release 3.11.0 is:
running 1 test
thread 'test_chunk_capacity' panicked at 'assertion failed: `(left != right)`
left: `36800`,
right: `36800`', my_test.rs
Documentation for
chunk_capacity()
says:However:
Actual output as of release 3.11.0 is: