10000 Added USE_JEMALLOC_CHECKS cmake option (#20352) · trooso/arangodb@d27984c · GitHub
[go: up one dir, main page]

Skip to content

Commit d27984c

Browse files
authored
Added USE_JEMALLOC_CHECKS cmake option (arangodb#20352)
* Added CMake option `USE_JEMALLOC_CHECKS` to toggle the usage of extra safety checks in jemalloc. The option is currently enabled by default, but can be turned off when there are performance concerns.
1 parent 6f9cfae commit d27984c

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

3rdParty/jemalloc/CMakeLists.txt

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ if (LINUX OR DARWIN)
2727
set(JEMALLOC_CONFIG "background_thread:true,cache_oblivious:false")
2828
endif ()
2929

30+
if (USE_JEMALLOC_CHECKS)
31+
set(JEMALLOC_CHECKS "--enable-opt-safety-checks" "--enable-opt-size-checks")
32+
else ()
33+
set(JEMALLOC_CHECKS "")
34+
endif ()
35+
3036
if (USE_JEMALLOC_PROF)
31-
if (USE_LIBUNWIND)
32-
# Note that CPPFLAGS are passed by jemalloc to both C and C++ compilers,
33-
# and to the preprocessor, and to dependency file generation. This is the
34-
# right place for includes.
35-
SET(JEMALLOC_CPPFLAGS "-I${LIBUNWIND_HOME}/include")
36-
SET(JEMALLOC_PROF "--enable-prof" "--enable-prof-libunwind" "--with-static-libunwind=${LIBUNWIND_LIB}")
37-
else ()
38-
SET(JEMALLOC_PROF "--enable-prof")
39-
endif()
37+
if (USE_LIBUNWIND)
38+
# Note that CPPFLAGS are passed by jemalloc to both C and C++ compilers,
39+
# and to the preprocessor, and to dependency file generation. This is the
40+
# right place for includes.
41+
set(JEMALLOC_CPPFLAGS "-I${LIBUNWIND_HOME}/include")
42+
set(JEMALLOC_PROF "--enable-prof" "--enable-prof-libunwind" "--with-static-libunwind=${LIBUNWIND_LIB}")
43+
else ()
44+
set(JEMALLOC_PROF "--enable-prof")
45+
endif()
4046
endif ()
4147

4248
set(JEMALLOC_LIB "${CMAKE_CURRENT_BINARY_DIR}/lib/libjemalloc.a")
@@ -66,9 +72,8 @@ if (LINUX OR DARWIN)
6672
--prefix=${CMAKE_CURRENT_BINARY_DIR}
6773
--with-malloc-conf=${JEMALLOC_CONFIG}
6874
--with-version=${JEMALLOC_VERSION}-0-g0
69-
--enable-opt-safety-checks
70-
--enable-opt-size-checks
7175
${JEMALLOC_PROF}
76+
${JEMALLOC_CHECKS}
7277
BUILD_COMMAND
7378
$(MAKE) build_lib_static
7479
INSTALL_COMMAND

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
devel
22
-----
33

4+
* Added CMake option `USE_JEMALLOC_CHECKS` to toggle the usage of extra safety
5+
checks in jemalloc. The option is currently enabled by default, but can be
6+
turned off when there are performance concerns.
7+
48
* Fixed BTS-1703: Cannot chain multiple UPSERTS.
59

610
* Fixed issue #17673: Adds timezone conversion as an optional parameter in

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ endfunction()
813813
# ------------------------------------------------------------------------------
814814

815815
option(USE_JEMALLOC_PROF "use jemalloc profiler" ON)
816+
option(USE_JEMALLOC_CHECKS "use jemalloc extended safety checks" ON)
816817

817818
if (USE_JEMALLOC)
818819
add_definitions("-DARANGODB_HAVE_JEMALLOC=1")

0 commit comments

Comments
 (0)
0