mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Correct small allocations
Change-Id: I0bb5e3f58eb2cd1ab0a82b5cae476c95df94b4a9
This commit is contained in:
1 parent
c3bacc0572
commit
4fbc7baca1
2 files changed
+2
-2
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user