mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
normalize numa node
This commit is contained in:
parent
2d10c78587
commit
57dd69265a
1 changed files with 2 additions and 0 deletions
|
@ -383,6 +383,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue