mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Dep/Jemalloc: Enable MADV_FREE if available
(cherry picked from commit 10ad43916f)
This commit is contained in:
@@ -39,7 +39,7 @@ install:
|
||||
- mysql -uroot -e 'create database test_mysql;'
|
||||
- mkdir 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 ..
|
||||
- chmod +x contrib/check_updates.sh
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
* MADV_FREE, though typically with higher
|
||||
* system overhead.
|
||||
*/
|
||||
/*#define JEMALLOC_PURGE_MADVISE_FREE*/
|
||||
@JEM_MADFREE_DEF@ JEMALLOC_PURGE_MADVISE_FREE
|
||||
#define JEMALLOC_PURGE_MADVISE_DONTNEED
|
||||
#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user