This is an automated email from the ASF dual-hosted git repository.

zanmato pushed a commit to branch vector-placement-addressing-comments
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit b82ad94b7dd1612d77cc1c692cab706aa869cc96
Author: Rossi Sun <[email protected]>
AuthorDate: Wed Jan 15 19:58:33 2025 +0800

    Allocate uninitialized buffer and fill the capacity bytes
---
 cpp/src/arrow/compute/kernels/vector_swizzle.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cpp/src/arrow/compute/kernels/vector_swizzle.cc 
b/cpp/src/arrow/compute/kernels/vector_swizzle.cc
index 1611a2e90b..43eeb37c94 100644
--- a/cpp/src/arrow/compute/kernels/vector_swizzle.cc
+++ b/cpp/src/arrow/compute/kernels/vector_swizzle.cc
@@ -155,10 +155,9 @@ struct InversePermutationImpl {
   Status AllocateValidityBufAndFill(bool valid) {
     DCHECK_EQ(validity_buf_, nullptr);
 
-    ARROW_ASSIGN_OR_RAISE(validity_buf_,
-                          AllocateEmptyBitmap(output_length_, 
ctx_->memory_pool()));
+    ARROW_ASSIGN_OR_RAISE(validity_buf_, ctx_->Allocate(output_length_));
     auto validity = validity_buf_->mutable_data_as<uint8_t>();
-    std::memset(validity, valid ? 0xff : 0, validity_buf_->size());
+    std::memset(validity, valid ? 0xff : 0, validity_buf_->capacity());
 
     return Status::OK();
   }

Reply via email to