zanmato1984 commented on code in PR #41335:
URL: https://github.com/apache/arrow/pull/41335#discussion_r1600345852


##########
cpp/src/arrow/compute/util_internal.h:
##########
@@ -27,5 +29,56 @@ void CheckAlignment(const void* ptr) {
   ARROW_DCHECK(reinterpret_cast<uint64_t>(ptr) % sizeof(T) == 0);
 }
 
+/// Storage used to allocate temporary vectors of a batch size.
+/// Temporary vectors should resemble allocating temporary variables on the 
stack
+/// but in the context of vectorized processing where we need to store a 
vector of
+/// temporaries instead of a single value.
+class ARROW_EXPORT TempVectorStack {
+  template <typename>
+  friend class TempVectorHolder;
+
+ public:
+  Status Init(MemoryPool* pool, int64_t size);
+
+  int64_t AllocatedSize() const { return top_; }

Review Comment:
   This is not related to the purpose of this PR but rather something remaining 
in https://github.com/apache/arrow/pull/41352#discussion_r1598969656 and too 
trivial for another PR.



##########
cpp/src/arrow/compute/row/grouper.cc:
##########
@@ -600,6 +600,7 @@ struct GrouperFastImpl : public Grouper {
   }
 
   Status Reset() override {
+    ARROW_DCHECK_EQ(temp_stack_.AllocatedSize(), 0);

Review Comment:
   This is not related to the purpose of this PR but rather something remaining 
in https://github.com/apache/arrow/pull/41352#discussion_r1598969656 and too 
trivial for another PR.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to