save-buffer commented on code in PR #12289:
URL: https://github.com/apache/arrow/pull/12289#discussion_r860314520


##########
cpp/src/arrow/compute/exec/util.h:
##########
@@ -92,7 +92,7 @@ class TempVectorStack {
   Status Init(MemoryPool* pool, int64_t size) {
     num_vectors_ = 0;
     top_ = 0;
-    buffer_size_ = size;
+    buffer_size_ = PaddedAllocationSize(size) + kPadding + 2 * 
sizeof(uint64_t);

Review Comment:
   It's weird if you `Init` the TempVectorStack with one size and then it 
segfaults if you try to `alloc` that much memory. That's because `alloc` bumps 
the stack by `PaddedAllocationSize(size) + 2 * sizeof(uint64_t)`   



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