aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/common/erl_mmap.h
diff options
context:
space:
mode:
authorKenji Rikitake <[email protected]>2016-06-10 09:39:08 +0900
committerKenji Rikitake <[email protected]>2016-06-10 10:46:02 +0900
commit6c5277b154316137ebc9f83ed8566357ffebd3e0 (patch)
tree84675a8eec8569c914c32825d6911550dd39c05c /erts/emulator/sys/common/erl_mmap.h
parent2c9dba638a8bda92e3db2d5c07e6ba251330c7ca (diff)
downloadotp-6c5277b154316137ebc9f83ed8566357ffebd3e0.tar.gz
otp-6c5277b154316137ebc9f83ed8566357ffebd3e0.tar.bz2
otp-6c5277b154316137ebc9f83ed8566357ffebd3e0.zip
Disregard MAP_NORESERVE for FreeBSD
A fix for running 19.0-rc2 on FreeBSD with HiPE enabled. * erl_mmap.h: disregard MAP_NORESERVE for FreeBSD MAP_NORESERVE is undefined in FreeBSD 10.x and later. This is to enable 64bit HiPE experimentally on FreeBSD. Note that on FreeBSD MAP_NORESERVE was "never implemented" even before 11.x (and the flag does not exist in /usr/src/sys/vm/mmap.c of 10.3-STABLE r301478 either), and HiPE was working on OTP 18.3.3, so mandating MAP_NORESERVE on FreeBSD might not be needed. See the following message on how MAP_NORESERVE was treated on FreeBSD: <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20150202/122958.html> * erl_mmap.c: disable MAP_NORESERVE for FreeBSD * See also <https://github.com/erlang/otp/pull/925/commits/b02ce940c8738785ad018c9f758ca0d05d256bbb>
Diffstat (limited to 'erts/emulator/sys/common/erl_mmap.h')
-rw-r--r--erts/emulator/sys/common/erl_mmap.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h
index 7ac61a82c1..fa51b663fa 100644
--- a/erts/emulator/sys/common/erl_mmap.h
+++ b/erts/emulator/sys/common/erl_mmap.h
@@ -38,7 +38,17 @@
# if HAVE_MREMAP
# define ERTS_HAVE_OS_MREMAP 1
# endif
-# if defined(MAP_FIXED) && defined(MAP_NORESERVE)
+/*
+ * MAP_NORESERVE is undefined in FreeBSD 10.x and later.
+ * This is to enable 64bit HiPE experimentally on FreeBSD.
+ * Note that on FreeBSD MAP_NORESERVE was "never implemented"
+ * even before 11.x (and the flag does not exist in /usr/src/sys/vm/mmap.c
+ * of 10.3-STABLE r301478 either), and HiPE was working on OTP 18.3.3,
+ * so mandating MAP_NORESERVE on FreeBSD might not be needed.
+ * See the following message on how MAP_NORESERVE was treated on FreeBSD:
+ * <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20150202/122958.html>
+ */
+# if defined(MAP_FIXED) && (defined(MAP_NORESERVE) || defined(__FreeBSD__))
# define ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION 1
# endif
#endif