From 734a95b07693c56d7d8c00ba9cb32e395f1bc46e Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 14 Apr 2020 10:52:38 +0200 Subject: [PATCH] ARROW-8438: [C++] Fix crash in io-memory-benchmark --- 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 d27fec0e5b00d..7e6ba781a0193 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 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(n_threads)); ABORT_NOT_OK(writer.Write(src->data(), src->size())); }