aboutsummaryrefslogtreecommitdiff
path: root/dep/jemalloc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'dep/jemalloc/CMakeLists.txt')
-rw-r--r--dep/jemalloc/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/dep/jemalloc/CMakeLists.txt b/dep/jemalloc/CMakeLists.txt
index 3e2ab40b821..33e586fe54b 100644
--- a/dep/jemalloc/CMakeLists.txt
+++ b/dep/jemalloc/CMakeLists.txt
@@ -10,6 +10,8 @@
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
# We need to generate the jemalloc_def.h header based on platform-specific settings
+ CHECK_SYMBOL_EXISTS(MADV_FREE "sys/mman.h" HAVE_MADV_FREE)
+
if (PLATFORM EQUAL 32)
set(JEM_SIZEDEF 2)
set(JEM_TLSMODEL)
@@ -20,6 +22,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
set(JEM_VADDRBITS 48)
endif()
+ if (HAVE_MADV_FREE)
+ set(JEM_MADFREE_DEF "#define")
+ else()
+ set(JEM_MADFREE_DEF "#undef")
+ endif()
+
# Create the header, so we can use it
configure_file(
"${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_internal_defs.h.in.cmake"