Skip to content

Commit 9afb0e1

Browse files
authored
gh-112027: Don't print mimalloc warning after mmap() call (gh-113372)
gh-112027: Don't print mimalloc warning after mmap This changes the warning to a "verbose"-level message in prim.c. The address passed to mmap is only a hint -- it's normal for mmap() to sometimes not respect the hint and return a different address.
1 parent 7de9855 commit 9afb0e1

File tree

1 file changed

+2
-2
lines changed
  • Objects/mimalloc/prim/unix

1 file changed

+2
-2
lines changed

Objects/mimalloc/prim/unix/prim.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void* unix_mmap_prim(void* addr, size_t size, size_t try_alignment, int p
170170
p = mmap(addr, size, protect_flags, flags | MAP_ALIGNED(n), fd, 0);
171171
if (p==MAP_FAILED || !_mi_is_aligned(p,try_alignment)) {
172172
int err = errno;
173-
_mi_warning_message("unable to directly request aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx, hint address: %p)\n", err, err, size, try_alignment, addr);
173+
_mi_verbose_message("unable to directly request aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx, hint address: %p)\n", err, err, size, try_alignment, addr);
174174
}
175175
if (p!=MAP_FAILED) return p;
176176
// fall back to regular mmap
@@ -195,7 +195,7 @@ static void* unix_mmap_prim(void* addr, size_t size, size_t try_alignment, int p
195195
#else
196196
int err = errno;
197197
#endif
198-
_mi_warning_message("unable to directly request hinted aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx, hint address: %p)\n", err, err, size, try_alignment, hint);
198+
_mi_verbose_message("unable to directly request hinted aligned OS memory (error: %d (0x%x), size: 0x%zx bytes, alignment: 0x%zx, hint address: %p)\n", err, err, size, try_alignment, hint);
199199
}
200200
if (p!=MAP_FAILED) return p;
201201
// fall back to regular mmap

0 commit comments

Comments
 (0)