diff --git a/contrib/libtcmalloc/CMakeLists.txt b/contrib/libtcmalloc/CMakeLists.txt index d5bac57dfab..47a9e57a25b 100644 --- a/contrib/libtcmalloc/CMakeLists.txt +++ b/contrib/libtcmalloc/CMakeLists.txt @@ -1,5 +1,5 @@ add_definitions( - -DNO_TCMALLOC_SAMPLES -DNO_TCMALLOC_SAMPLES + -DNO_TCMALLOC_SAMPLES -DNDEBUG -DNO_FRAME_POINTER -Wwrite-strings -Wno-sign-compare -Wno-unused-result -Wno-deprecated-declarations -Wno-unused-function diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index ab83971e0e7..b19f55556b2 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -11,10 +11,6 @@ include_directories (BEFORE ${ClickHouse_SOURCE_DIR}/contrib/libre2/) include_directories (BEFORE ${ClickHouse_BINARY_DIR}/contrib/libre2/) include_directories (${ClickHouse_SOURCE_DIR}/libs/libdaemon/include/) -if (NOT ENABLE_LIBTCMALLOC) - add_definitions(-DNO_TCMALLOC) -endif () - if (NOT NO_WERROR) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") diff --git a/dbms/src/Interpreters/AsynchronousMetrics.cpp b/dbms/src/Interpreters/AsynchronousMetrics.cpp index 00b2ec84d43..ca22abd6d01 100644 --- a/dbms/src/Interpreters/AsynchronousMetrics.cpp +++ b/dbms/src/Interpreters/AsynchronousMetrics.cpp @@ -9,7 +9,9 @@ #include #include -#ifndef NO_TCMALLOC +#include + +#if ENABLE_LIBTCMALLOC #include /// Initializing malloc extension in global constructor as required. @@ -197,7 +199,7 @@ void AsynchronousMetrics::update() set("MaxPartCountForPartition", max_part_count_for_partition); } -#ifndef NO_TCMALLOC +#if ENABLE_LIBTCMALLOC { /// tcmalloc related metrics. Remove if you switch to different allocator. diff --git a/dbms/src/Server/main.cpp b/dbms/src/Server/main.cpp index 678da4c734e..d7519fa6e9a 100644 --- a/dbms/src/Server/main.cpp +++ b/dbms/src/Server/main.cpp @@ -1,4 +1,5 @@ -#ifndef NO_TCMALLOC +#include +#if ENABLE_LIBTCMALLOC #include #endif #include "Server.h" @@ -36,7 +37,7 @@ static bool isClickhouseApp(const std::string & app_suffix, std::vector int main(int argc_, char ** argv_) { -#ifndef NO_TCMALLOC +#if ENABLE_LIBTCMALLOC MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit", false); #endif diff --git a/libs/libcommon/include/common/config_common.h.in b/libs/libcommon/include/common/config_common.h.in index 55edaf6e987..a743aeb05b0 100644 --- a/libs/libcommon/include/common/config_common.h.in +++ b/libs/libcommon/include/common/config_common.h.in @@ -3,3 +3,4 @@ // .h autogenerated by cmake ! #cmakedefine01 APPLE_SIERRA_OR_NEWER +#cmakedefine01 ENABLE_LIBTCMALLOC