You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2020/04/14 09:53:11 UTC

[arrow] branch master updated: ARROW-8438: [C++] Fix crash in io-memory-benchmark

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

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new ac49d1d  ARROW-8438: [C++] Fix crash in io-memory-benchmark
ac49d1d is described below

commit ac49d1d5eb494dce5550b530bb18799589ba57f6
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Tue Apr 14 11:52:54 2020 +0200

    ARROW-8438: [C++] Fix crash in io-memory-benchmark
    
    Closes #6929 from pitrou/ARROW-8438-fix-io-mem-benchmark
    
    Authored-by: Antoine Pitrou <an...@python.org>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 cpp/src/arrow/io/memory_benchmark.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/io/memory_benchmark.cc b/cpp/src/arrow/io/memory_benchmark.cc
index d27fec0..7e6ba78 100644
--- a/cpp/src/arrow/io/memory_benchmark.cc
+++ b/cpp/src/arrow/io/memory_benchmark.cc
@@ -295,12 +295,12 @@ static void ParallelMemoryCopy(benchmark::State& state) {  // NOLINT non-const r
   const int64_t buffer_size = kMemoryPerCore;
 
   auto src = *AllocateBuffer(buffer_size);
-  auto dst = *AllocateBuffer(buffer_size);
+  std::shared_ptr<Buffer> dst = *AllocateBuffer(buffer_size);
 
   random_bytes(buffer_size, 0, src->mutable_data());
 
   while (state.KeepRunning()) {
-    io::FixedSizeBufferWriter writer(std::move(dst));
+    io::FixedSizeBufferWriter writer(dst);
     writer.set_memcopy_threads(static_cast<int>(n_threads));
     ABORT_NOT_OK(writer.Write(src->data(), src->size()));
   }