From 50b473c8839f5408df179bdf6f2b3fd2cf5c3b2f Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 2 Nov 2018 14:01:45 -0700 Subject: [PATCH] Set commit properly for FreeBSD w/ overcommit. When overcommit is enabled, commit needs to be set when doing mmap(). The regression was introduced in f80c97e. --- src/pages.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages.c b/src/pages.c index 479a89e5..9f3085cb 100644 --- a/src/pages.c +++ b/src/pages.c @@ -186,6 +186,10 @@ pages_map(void *addr, size_t size, size_t alignment, bool *commit) { * touching existing mappings, and to mmap with specific alignment. */ { + if (os_overcommits) { + *commit = true; + } + int prot = *commit ? PAGES_PROT_COMMIT : PAGES_PROT_DECOMMIT; int flags = mmap_flags;