zhztheplayer commented on a change in pull request #7030:
URL: https://github.com/apache/arrow/pull/7030#discussion_r563299997



##########
File path: cpp/src/arrow/memory_pool.h
##########
@@ -149,6 +149,43 @@ class ARROW_EXPORT ProxyMemoryPool : public MemoryPool {
   std::unique_ptr<ProxyMemoryPoolImpl> impl_;
 };
 
+class ARROW_EXPORT ReservationListener {
+ public:
+  virtual ~ReservationListener();
+
+  virtual Status OnReservation(int64_t size) = 0;
+  virtual Status OnRelease(int64_t size) = 0;
+
+ protected:
+  ReservationListener();
+};
+
+class ARROW_EXPORT ReservationListenableMemoryPool : public MemoryPool {

Review comment:
       @pitrou Here is a previous discussion about "reserve" bytes from 
Bits.java before the actual allocation 
https://github.com/apache/arrow/pull/7030#issuecomment-679355309. "pre-reserve" 
does not actually allocate memory but call a customized listener to reserve 
from other resource managers such as JVM native memory, for other examples, 
Spark or Yarn or something. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to