mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-18 21:19:31 +03:00
No need of an attemps after a failure with a casual mapping.
This commit is contained in:
parent
cf4eacf979
commit
3f894c9bf6
1 changed files with 2 additions and 2 deletions
4
src/os.c
4
src/os.c
|
@ -293,9 +293,9 @@ static void* mi_unix_mmap(size_t size, size_t try_alignment, int protect_flags)
|
||||||
p = mi_unix_mmapx(size, try_alignment, protect_flags, lflags, fd);
|
p = mi_unix_mmapx(size, try_alignment, protect_flags, lflags, fd);
|
||||||
#ifdef MADV_HUGEPAGE
|
#ifdef MADV_HUGEPAGE
|
||||||
if (p == MAP_FAILED) {
|
if (p == MAP_FAILED) {
|
||||||
lflags &= MAP_HUGETLB; // large page could be set to madvise only
|
lflags = flags; // large page could be set to madvise only
|
||||||
p = mi_unix_mmapx(size, try_alignment, protect_flags, lflags, fd);
|
p = mi_unix_mmapx(size, try_alignment, protect_flags, lflags, fd);
|
||||||
if (p == MAP_FAILED) p = NULL; // we did what we could at this stage
|
if (p == MAP_FAILED) return NULL; // we did what we could at this stage
|
||||||
else madvise(p, size, MADV_HUGEPAGE);
|
else madvise(p, size, MADV_HUGEPAGE);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue