marin-ma commented on code in PR #9424:
URL: https://github.com/apache/incubator-gluten/pull/9424#discussion_r2063919739


##########
cpp/velox/memory/VeloxMemoryManager.cc:
##########
@@ -168,7 +168,13 @@ class ListenableArbitrator : public 
velox::memory::MemoryArbitrator {
     }
     auto reclaimedFreeBytes = shrinkPool(pool, 0);
     auto neededBytes = velox::bits::roundUp(bytes - reclaimedFreeBytes, 
memoryPoolTransferCapacity_);
-    listener_->allocationChanged(neededBytes);
+    try {
+      listener_->allocationChanged(neededBytes);
+    } catch (const std::exception& e) {
+      // if allocationChanged failed, we need to free the reclaimed bytes
+      listener_->allocationChanged(-reclaimedFreeBytes);
+      throw e;

Review Comment:
   We should use `throw;` instead of `throw e;`. Otherwise the original 
exception type will be cast down to `std::exception`.



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