timmyb32r opened a new pull request, #11878: URL: https://github.com/apache/arrow-rs/pull/11878
### Which issue does this PR close? None — standalone bug fix. ### Rationale for this change `Buffer::into_vec` calls `mem::forget(bytes)` to transfer ownership of the allocation to a `Vec`. With the `pool` feature enabled, this also leaks the memory reservation: its destructor never runs, so the pool continues reporting the allocation as used even after the vector is dropped. ### What changes are included in this PR? Release the memory reservation before forgetting `Bytes` and transferring the allocation to the vector. ### Are these changes tested? Added a regression test verifying that: - Successful conversion releases the reservation and preserves the allocation and its contents. - Failed conversion of a shared buffer keeps the reservation intact. The test fails before the fix and passes afterward. Validation passed: - `cargo test -p arrow-buffer` - `cargo test -p arrow-buffer --all-features` - `cargo test --workspace` - `cargo clippy --workspace --all-targets --all-features -- -D warnings` - Formatting and spelling checks. ### Are there any significant user-facing changes? With the `pool` feature enabled, converting a buffer into a vector now releases its memory reservation. ### AI assistance Codex identified the issue, generated the fix and regression test, ran validation, and drafted this PR description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
