alamb commented on code in PR #6590:
URL: https://github.com/apache/arrow-rs/pull/6590#discussion_r1808601323
##########
arrow-buffer/src/buffer/immutable.rs:
##########
@@ -357,6 +357,12 @@ impl Buffer {
pub fn ptr_eq(&self, other: &Self) -> bool {
self.ptr == other.ptr && self.length == other.length
}
+
+ /// Register this [`Buffer`] with the provided [`MemoryPool`]
+ #[cfg(feature = "pool")]
+ pub fn claim(&self, pool: &dyn crate::MemoryPool) {
Review Comment:
That is interesting -- so the idea is that this would support cooperatively
assigning / tracking usage (rather than relying on some global allocator to do
so).
That aligns pretty nicely with the "no overhead unless asked" and
"everything being explicit" principles
##########
arrow-buffer/src/buffer/immutable.rs:
##########
@@ -357,6 +357,12 @@ impl Buffer {
pub fn ptr_eq(&self, other: &Self) -> bool {
self.ptr == other.ptr && self.length == other.length
}
+
+ /// Register this [`Buffer`] with the provided [`MemoryPool`]
+ #[cfg(feature = "pool")]
+ pub fn claim(&self, pool: &dyn crate::MemoryPool) {
Review Comment:
I think this API would be easier to use / manage if it also returned the
prior reservation, if any
--
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]