This is an automated email from the ASF dual-hosted git repository.
wesm 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 482fc58 ARROW-2210: [C++] Reset ptr on failed memory allocation
482fc58 is described below
commit 482fc584dcc09ea808062e0869a8c63cf7d5eb4c
Author: Uwe L. Korn <[email protected]>
AuthorDate: Tue Feb 27 10:41:39 2018 -0500
ARROW-2210: [C++] Reset ptr on failed memory allocation
Author: Uwe L. Korn <[email protected]>
Closes #1672 from xhochy/ARROW-2210 and squashes the following commits:
6e5febe9 <Uwe L. Korn> ARROW-2210: Reset ptr on failed memory allocation
---
cpp/src/arrow/memory_pool.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cpp/src/arrow/memory_pool.cc b/cpp/src/arrow/memory_pool.cc
index b8cd9c2..dedab7e 100644
--- a/cpp/src/arrow/memory_pool.cc
+++ b/cpp/src/arrow/memory_pool.cc
@@ -107,10 +107,12 @@ class DefaultMemoryPool : public MemoryPool {
Status Reallocate(int64_t old_size, int64_t new_size, uint8_t** ptr)
override {
#ifdef ARROW_JEMALLOC
+ uint8_t* previous_ptr = *ptr;
*ptr = reinterpret_cast<uint8_t*>(rallocx(*ptr, new_size,
MALLOCX_ALIGN(kAlignment)));
if (*ptr == NULL) {
std::stringstream ss;
ss << "realloc of size " << new_size << " failed";
+ *ptr = previous_ptr;
return Status::OutOfMemory(ss.str());
}
#else
--
To stop receiving notification emails like this one, please contact
[email protected].