felipecrv commented on code in PR #40774:
URL: https://github.com/apache/arrow/pull/40774#discussion_r1538489549


##########
cpp/src/arrow/io/file_test.cc:
##########
@@ -461,6 +461,11 @@ class MyMemoryPool : public MemoryPool {
     return Status::OK();
   }
 
+  Status ReallocateNoCopy(int64_t old_size, int64_t new_size, int64_t 
alignment,

Review Comment:
   Name suggestion: `TryResize`.
   
   Workloads taking advantage of this API are going to "try a resize" with the 
exact size needed for the operation being performed and then they are going to 
call `Reallocate` with a more generous size to amortize the cost of copies. 
Naming it `ReallocateNoCopy` creates the need to explain to users/developers 
why isn't `ReallocateNoCopy` the implementation of `Reallocate` in the first 
place. The "Try" prefix will also indicate that caller should be ready to 
handle failure gracefully. A bad Status is not an exceptional case, it's a very 
likely result.



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

Reply via email to