mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
Fix incorrect MAP_HUGE_1GB check #793
This commit is contained in:
parent
7b398ad924
commit
3fe3d540b6
1 changed files with 1 additions and 1 deletions
|
@ -279,7 +279,7 @@ static void* unix_mmap(void* addr, size_t size, size_t try_alignment, int protec
|
||||||
*is_large = true;
|
*is_large = true;
|
||||||
p = unix_mmap_prim(addr, size, try_alignment, protect_flags, lflags, lfd);
|
p = unix_mmap_prim(addr, size, try_alignment, protect_flags, lflags, lfd);
|
||||||
#ifdef MAP_HUGE_1GB
|
#ifdef MAP_HUGE_1GB
|
||||||
if (p == NULL && (lflags & MAP_HUGE_1GB) != 0) {
|
if (p == NULL && (lflags & MAP_HUGE_1GB) == MAP_HUGE_1GB) {
|
||||||
mi_huge_pages_available = false; // don't try huge 1GiB pages again
|
mi_huge_pages_available = false; // don't try huge 1GiB pages again
|
||||||
_mi_warning_message("unable to allocate huge (1GiB) page, trying large (2MiB) pages instead (errno: %i)\n", errno);
|
_mi_warning_message("unable to allocate huge (1GiB) page, trying large (2MiB) pages instead (errno: %i)\n", errno);
|
||||||
lflags = ((lflags & ~MAP_HUGE_1GB) | MAP_HUGE_2MB);
|
lflags = ((lflags & ~MAP_HUGE_1GB) | MAP_HUGE_2MB);
|
||||||
|
|
Loading…
Add table
Reference in a new issue