waynexia commented on code in PR #6590:
URL: https://github.com/apache/arrow-rs/pull/6590#discussion_r1810876731


##########
arrow-buffer/src/pool.rs:
##########
@@ -0,0 +1,79 @@
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Arc;
+
+/// A [`MemoryPool`] can be used to track memory usage by 
[`Buffer`](crate::Buffer)
+pub trait MemoryPool {
+    fn register(&self, size: usize) -> Box<dyn MemoryReservation>;
+}
+
+/// A memory reservation within a [`MemoryPool`] that is freed on drop
+pub trait MemoryReservation {
+    fn resize(&mut self, new: usize);

Review Comment:
   Mutable buffer might need this. It may resize its reservation dynamically



-- 
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]

Reply via email to