From a99c4287faabab35fc8581527c274dc020e583f3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 4 May 2020 20:37:29 +0900 Subject: [PATCH] Do not pollute env with USE_TCMALLOC --- build/build_config.h | 6 ------ build/config/BUILD.gn | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build/build_config.h b/build/build_config.h index fc96169..ede6c32 100755 --- a/build/build_config.h +++ b/build/build_config.h @@ -74,12 +74,6 @@ #define OS_POSIX 1 #endif -// Use tcmalloc -#if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \ - !defined(NO_TCMALLOC) -#define USE_TCMALLOC 1 -#endif - // Compiler detection. #if defined(__GNUC__) #define COMPILER_GCC 1 diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index f9c54f6..991cbc1 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -65,7 +65,9 @@ config("feature_flags") { if (use_glib) { defines += [ "USE_GLIB=1" ] } - if (use_allocator != "tcmalloc") { + if (use_allocator == "tcmalloc") { + defines += [ "USE_TCMALLOC" ] + } else { defines += [ "NO_TCMALLOC" ] } if (is_asan || is_lsan || is_tsan || is_msan) {