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


##########
cpp/velox/memory/VeloxMemoryManager.cc:
##########
@@ -94,20 +95,22 @@ class ListenableArbitrator : public 
velox::memory::MemoryArbitrator {
     // Since
     // 
https://github.com/facebookincubator/velox/pull/9557/files#diff-436e44b7374032f8f5d7eb45869602add6f955162daa2798d01cc82f8725724dL812-L820,
     // We should pass bytes as parameter "reservationBytes" when calling 
::grow.
-    const uint64_t freeBytes = pool->freeBytes();
-    if (freeBytes >= bytes) {
-      bool reserved = pool->grow(0, bytes);
-      GLUTEN_CHECK(
-          reserved,
-          "Unexpected: Failed to reserve " + std::to_string(bytes) +
-              " bytes although there is enough space, free bytes: " + 
std::to_string(freeBytes));
-      return 0;
+    auto freeByes = pool->freeBytes();
+    if (freeByes > bytes) {
+      if (pool->grow(0, bytes)) {
+        return 1;

Review Comment:
   What's the meaning of `return 1`? If the return value is unused, how about 
making the function return `void`?



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