Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: remove add_definitions(-DNO_TCMALLOC), instead use ENABLE_LIBTCMALLOC from config #375

Merged
merged 4 commits into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/libtcmalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions dbms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions dbms/src/Interpreters/AsynchronousMetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include <DB/Databases/IDatabase.h>
#include <chrono>

#ifndef NO_TCMALLOC
#include <common/config_common.h>

#if ENABLE_LIBTCMALLOC
#include <gperftools/malloc_extension.h>

/// Initializing malloc extension in global constructor as required.
Expand Down Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions dbms/src/Server/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#ifndef NO_TCMALLOC
#include <common/config_common.h>
#if ENABLE_LIBTCMALLOC
#include <gperftools/malloc_extension.h>
#endif
#include "Server.h"
Expand Down Expand Up @@ -36,7 +37,7 @@ static bool isClickhouseApp(const std::string & app_suffix, std::vector<char *>

int main(int argc_, char ** argv_)
{
#ifndef NO_TCMALLOC
#if ENABLE_LIBTCMALLOC
MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit", false);
#endif

Expand Down
1 change: 1 addition & 0 deletions libs/libcommon/include/common/config_common.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
// .h autogenerated by cmake !

#cmakedefine01 APPLE_SIERRA_OR_NEWER
#cmakedefine01 ENABLE_LIBTCMALLOC