ZhangHuiGui commented on code in PR #40484:
URL: https://github.com/apache/arrow/pull/40484#discussion_r1541117739
##########
cpp/src/arrow/compute/util.cc:
##########
@@ -32,10 +32,10 @@ using internal::CpuInfo;
namespace util {
void TempVectorStack::alloc(uint32_t num_bytes, uint8_t** data, int* id) {
- int64_t new_top = top_ + PaddedAllocationSize(num_bytes) + 2 *
sizeof(uint64_t);
- // Stack overflow check (see GH-39582).
+ const auto estimate_size = EstimateAllocSize(num_bytes);
// XXX cannot return a regular Status because most consumers do not either.
- ARROW_CHECK_LE(new_top, buffer_size_) << "TempVectorStack::alloc overflow";
+ ARROW_DCHECK_OK(CheckAllocOverflow(estimate_size));
Review Comment:
Yes, you're right. ARROW_DCHECK_OK seems not work in NDEBUG mode.
--
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]