respect large pages for arena allocation
@@ -232,6 +232,7 @@ void* _mi_arena_alloc_aligned(size_t size, size_t alignment, bool* commit, bool*
for (size_t i = 0; i < MI_MAX_ARENAS; i++) {
mi_arena_t* arena = (mi_arena_t*)mi_atomic_read_ptr_relaxed(mi_atomic_cast(void*, &mi_arenas[i]));
if (arena==NULL) break;
+ if (*large || !arena->is_large) { // large OS pages allowed, or arena is not large OS pages
size_t block_index = SIZE_MAX;
void* p = mi_arena_alloc(arena, bcount, is_zero, &block_index);
if (p != NULL) {
@@ -250,6 +251,7 @@ void* _mi_arena_alloc_aligned(size_t size, size_t alignment, bool* commit, bool*
}
}
}
+ }
// fall back to the OS
*is_zero = true;
