Correct small allocations

Change-Id: I0bb5e3f58eb2cd1ab0a82b5cae476c95df94b4a9
This commit is contained in:
Uwe L. Korn committed 2017-06-20 17:11:53 +02:00
1 parent c3bacc0572
commit 4fbc7baca1
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ TEST(stl_allocator, MemoryTracking) {
ASSERT_EQ(0, pool->bytes_allocated());
}
#if !(defined(ARROW_VALGRIND) || defined(ADDRESS_SANITIZER))
#if !(defined(ARROW_VALGRIND) || defined(ADDRESS_SANITIZER) || defined(ARROW_JEMALLOC))
TEST(stl_allocator, TestOOM) {
stl_allocator<uint64_t> alloc;
+1 -1
View File
@@ -53,7 +53,7 @@ Status AllocateAligned(int64_t size, uint8_t** out) {
return Status::OutOfMemory(ss.str());
}
#elif defined(ARROW_JEMALLOC)
*out = reinterpret_cast<uint8_t*>(mallocx(size, MALLOCX_ALIGN(kAlignment)));
*out = reinterpret_cast<uint8_t*>(mallocx(std::max(static_cast<size_t>(size), kAlignment), MALLOCX_ALIGN(kAlignment)));
if (*out == NULL) {
std::stringstream ss;
ss << "malloc of size " << size << " failed";