Dep/Jemalloc: Enable MADV_FREE if available
This commit is contained in:
1 parent
05b568813f
commit
a693169a7e
3 files changed
+10
-2
No files matched your search
+1
-1
@@ -33,7 +33,7 @@ install:
|
|||||||
- mysql -uroot -e 'create database test_mysql;'
|
- mysql -uroot -e 'create database test_mysql;'
|
||||||
- mkdir bin
|
- mkdir bin
|
||||||
- cd bin
|
- cd bin
|
||||||
- cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
|
- cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
|
||||||
- cd ..
|
- cd ..
|
||||||
- chmod +x contrib/check_updates.sh
|
- chmod +x contrib/check_updates.sh
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
|
||||||
# We need to generate the jemalloc_def.h header based on platform-specific settings
|
# 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)
|
if (PLATFORM EQUAL 32)
|
||||||
set(JEM_SIZEDEF 2)
|
set(JEM_SIZEDEF 2)
|
||||||
set(JEM_TLSMODEL)
|
set(JEM_TLSMODEL)
|
||||||
@@ -20,6 +22,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT NOJEM)
|
|||||||
set(JEM_VADDRBITS 48)
|
set(JEM_VADDRBITS 48)
|
||||||
endif()
|
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
|
# Create the header, so we can use it
|
||||||
configure_file(
|
configure_file(
|
||||||
"${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_internal_defs.h.in.cmake"
|
"${CMAKE_SOURCE_DIR}/dep/jemalloc/jemalloc_internal_defs.h.in.cmake"
|
||||||
|
|||||||
@@ -268,7 +268,7 @@
|
|||||||
* MADV_FREE, though typically with higher
|
* MADV_FREE, though typically with higher
|
||||||
* system overhead.
|
* system overhead.
|
||||||
*/
|
*/
|
||||||
/*#define JEMALLOC_PURGE_MADVISE_FREE*/
|
@JEM_MADFREE_DEF@ JEMALLOC_PURGE_MADVISE_FREE
|
||||||
#define JEMALLOC_PURGE_MADVISE_DONTNEED
|
#define JEMALLOC_PURGE_MADVISE_DONTNEED
|
||||||
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS 1
|
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS 1
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user