felipecrv commented on code in PR #41695:
URL: https://github.com/apache/arrow/pull/41695#discussion_r1604208197
##########
cpp/src/arrow/compute/util_internal.h:
##########
@@ -38,21 +38,24 @@ class ARROW_EXPORT TempVectorStack {
friend class TempVectorHolder;
public:
+ TempVectorStack() = default;
+ ~TempVectorStack();
+
+ TempVectorStack(const TempVectorStack&) = delete;
+ TempVectorStack& operator=(const TempVectorStack&) = delete;
+
+ TempVectorStack(TempVectorStack&&) = default;
+ TempVectorStack& operator=(TempVectorStack&&) = default;
+
Status Init(MemoryPool* pool, int64_t size);
int64_t AllocatedSize() const { return top_; }
private:
- static int64_t EstimatedAllocationSize(int64_t size) {
- return PaddedAllocationSize(size) + 2 * sizeof(uint64_t);
- }
-
static int64_t PaddedAllocationSize(int64_t num_bytes);
void alloc(uint32_t num_bytes, uint8_t** data, int* id);
void release(int id, uint32_t num_bytes);
- static constexpr uint64_t kGuard1 = 0x3141592653589793ULL;
- static constexpr uint64_t kGuard2 = 0x0577215664901532ULL;
Review Comment:
I think you should keep these, write them after the poisoning. Poisoning can
only help us with invalid reads, but not with undesirable writes.
They were added to help detecting bugs like
https://github.com/apache/arrow/pull/11335
##########
cpp/src/arrow/compute/util_internal.h:
##########
@@ -38,21 +38,24 @@ class ARROW_EXPORT TempVectorStack {
friend class TempVectorHolder;
public:
+ TempVectorStack() = default;
+ ~TempVectorStack();
+
+ TempVectorStack(const TempVectorStack&) = delete;
+ TempVectorStack& operator=(const TempVectorStack&) = delete;
+
+ TempVectorStack(TempVectorStack&&) = default;
+ TempVectorStack& operator=(TempVectorStack&&) = default;
Review Comment:
There are two handy macros for you here ->
https://github.com/apache/arrow/blob/f5ac05cca21bd07d888ce51050cebef64e65757c/cpp/src/arrow/util/macros.h#L27-L37
--
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]