tustvold commented on code in PR #6590:
URL: https://github.com/apache/arrow-rs/pull/6590#discussion_r1807256608
##########
arrow-buffer/src/bytes.rs:
##########
@@ -96,6 +101,12 @@ impl Bytes {
}
}
+ /// Register this [`Bytes`] with the provided [`MemoryPool`]
+ #[cfg(feature = "pool")]
+ pub fn claim(&self, pool: &dyn crate::MemoryPool) {
+ *self.reservation.lock().unwrap() =
Some(pool.register(self.capacity()));
Review Comment:
There are two implications of this formulation:
* We always allocate a new memory reservation which could be wasteful
* We allocate from the new pool before freeing the memory from the previous
reservation
--
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]