You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by uw...@apache.org on 2018/11/04 10:39:01 UTC
[arrow] branch master updated: ARROW-3517: [C++] Add a workaround
for MinGW-w64 32bit crash
This is an automated email from the ASF dual-hosted git repository.
uwe 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 eb500b6 ARROW-3517: [C++] Add a workaround for MinGW-w64 32bit crash
eb500b6 is described below
commit eb500b657895ed5f762aa7b819fcea2cb898358d
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Sun Nov 4 11:38:51 2018 +0100
ARROW-3517: [C++] Add a workaround for MinGW-w64 32bit crash
See also: https://sourceforge.net/p/mingw-w64/bugs/767/
Author: Kouhei Sutou <ko...@clear-code.com>
Closes #2899 from kou/cpp-wrap-memcpy and squashes the following commits:
e41899e1 <Kouhei Sutou> Add a workaround for MinGW-w64 32bit crash
---
cpp/src/arrow/util/memory.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cpp/src/arrow/util/memory.h b/cpp/src/arrow/util/memory.h
index eac6cc4..bc1a526 100644
--- a/cpp/src/arrow/util/memory.h
+++ b/cpp/src/arrow/util/memory.h
@@ -31,6 +31,10 @@ uint8_t* pointer_logical_and(const uint8_t* address, uintptr_t bits) {
return reinterpret_cast<uint8_t*>(value & bits);
}
+// This function is just for avoiding MinGW-w64 32bit crash.
+// See also: https://sourceforge.net/p/mingw-w64/bugs/767/
+void* wrap_memcpy(void* dst, const void* src, size_t n) { return memcpy(dst, src, n); }
+
// A helper function for doing memcpy with multiple threads. This is required
// to saturate the memory bandwidth of modern cpus.
void parallel_memcopy(uint8_t* dst, const uint8_t* src, int64_t nbytes,
@@ -59,7 +63,7 @@ void parallel_memcopy(uint8_t* dst, const uint8_t* src, int64_t nbytes,
std::vector<std::future<void*>> futures;
for (int i = 0; i < num_threads; i++) {
- futures.emplace_back(pool->Submit(memcpy, dst + prefix + i * chunk_size,
+ futures.emplace_back(pool->Submit(wrap_memcpy, dst + prefix + i * chunk_size,
left + i * chunk_size, chunk_size));
}
memcpy(dst, src, prefix);