Merge branch 'dev-exp' into dev-arena

This commit is contained in:
daan 2019-11-01 20:30:32 -07:00
commit 6916e6590f

View File

@ -384,6 +384,8 @@ static bool mi_arena_add(mi_arena_t* arena) {
// reserve at a specific numa node
int mi_reserve_huge_os_pages_at(size_t pages, int numa_node) mi_attr_noexcept {
size_t hsize = 0;
if (numa_node < -1) numa_node = -1;
if (numa_node >= 0) numa_node = numa_node % _mi_os_numa_node_count();
void* p = _mi_os_alloc_huge_os_pages(pages, numa_node, &hsize);
if (p==NULL) return ENOMEM;
_mi_verbose_message("reserved %zu huge (1GiB) pages\n", pages);