zhztheplayer commented on code in PR #5690:
URL: https://github.com/apache/incubator-gluten/pull/5690#discussion_r1597375646


##########
cpp/core/jni/JniCommon.h:
##########
@@ -348,47 +343,30 @@ class SparkAllocationListener final : public 
gluten::AllocationListener {
   }
 
  private:
-  int64_t reserve(int64_t diff) {
-    std::lock_guard<std::mutex> lock(mutex_);
-    bytesReserved_ += diff;
-    int64_t newBlockCount;
-    if (bytesReserved_ == 0) {
-      newBlockCount = 0;
-    } else {
-      // ceil to get the required block number
-      newBlockCount = (bytesReserved_ - 1) / blockSize_ + 1;
-    }
-    int64_t bytesGranted = (newBlockCount - blocksReserved_) * blockSize_;
-    blocksReserved_ = newBlockCount;
-    maxBytesReserved_ = std::max(maxBytesReserved_, bytesReserved_);
-    return bytesGranted;
-  }

Review Comment:
   Does `VeloxMemoryManager::arrowPool_` still use this code? Can we move it 
into another independent `gluten::AllocationListener` implementation which can 
wrap another listener? Like the way `BacktraceAllocationListener` adopted.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to