zhztheplayer commented on a change in pull request #7030:
URL: https://github.com/apache/arrow/pull/7030#discussion_r551694880
##########
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 {
+ public:
+ explicit ReservationListenableMemoryPool(MemoryPool* pool,
+
std::shared_ptr<ReservationListener> listener,
Review comment:
Would you suggest `unique_ptr` here? I thought that ReservationListener
instances may be able to share over pools. For example a listener simply for
logging reservations to std out.
----------------------------------------------------------------
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:
[email protected]