This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new ed729d1663 Remove TCMalloc support (#9915)
ed729d1663 is described below

commit ed729d166349bb377b1623911ae09d77d38578db
Author: JosiahWI <41302989+josia...@users.noreply.github.com>
AuthorDate: Mon Jun 26 14:13:08 2023 -0500

    Remove TCMalloc support (#9915)
    
    Remove TCMalloc from CMake and autoconf builds. TCMalloc had never been 
correctly configured in autoconf, so this isn't actually removing any 
functionality, and when it is correctly configured ATS crashes. Thus we're 
better off removing the crashy TCMalloc configuration from CMake.
    
    Closes #9861
---
 CMakeLists.txt                                     |  1 -
 build/jemalloc.m4                                  |  3 --
 build/mimalloc.m4                                  |  3 --
 build/tcmalloc.m4                                  | 56 ----------------------
 cmake/FindTCMalloc.cmake                           | 41 ----------------
 cmake/FindTSMallocReplacement.cmake                | 18 +------
 configure.ac                                       |  3 +-
 .../testing/blackbox-testing.en.rst                |  1 -
 include/tscore/ink_config.h.cmake.in               |  1 -
 include/tscore/ink_config.h.in                     |  1 -
 src/traffic_layout/info.cc                         |  1 -
 tests/README.md                                    |  1 -
 12 files changed, 2 insertions(+), 128 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09f68e7b23..12d5ab8736 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,6 @@ option(ENABLE_POSIX_CAP
     ON
 )
 option(ENABLE_PROFILER "Use gperftools profiler (default OFF)")
-option(ENABLE_TCMALLOC "Use TCMalloc (default OFF)")
 set(ENABLE_TPROXY
     "AUTO"
     CACHE
diff --git a/build/jemalloc.m4 b/build/jemalloc.m4
index 7acf1ebec5..ca788987ac 100644
--- a/build/jemalloc.m4
+++ b/build/jemalloc.m4
@@ -23,9 +23,6 @@ has_jemalloc=no
 AC_ARG_WITH([jemalloc], [AS_HELP_STRING([--with-jemalloc=DIR],[use a specific 
jemalloc library])],
 [
   if test "$withval" != "no"; then
-    if test "x${has_tcmalloc}" = "xyes"; then
-      AC_MSG_ERROR([Cannot compile with both jemalloc and tcmalloc])
-    fi
     if test "x${has_mimalloc}" = "xyes"; then
       AC_MSG_ERROR([Cannot compile with both jemalloc and mimalloc])
     fi
diff --git a/build/mimalloc.m4 b/build/mimalloc.m4
index f291d04afe..7d59f0728c 100644
--- a/build/mimalloc.m4
+++ b/build/mimalloc.m4
@@ -23,9 +23,6 @@ has_mimalloc=no
 AC_ARG_WITH([mimalloc], [AS_HELP_STRING([--with-mimalloc=DIR],[use a specific 
mimalloc library])],
 [
   if test "$withval" != "no"; then
-    if test "x${has_tcmalloc}" = "xyes"; then
-      AC_MSG_ERROR([Cannot compile with both mimalloc and tcmalloc])
-    fi
     if test "x${has_jemalloc}" = "xyes"; then
       AC_MSG_ERROR([Cannot compile with both mimalloc and jemalloc])
     fi
diff --git a/build/tcmalloc.m4 b/build/tcmalloc.m4
deleted file mode 100644
index d8027ad7ae..0000000000
--- a/build/tcmalloc.m4
+++ /dev/null
@@ -1,56 +0,0 @@
-dnl -------------------------------------------------------- -*- autoconf -*-
-dnl Licensed to the Apache Software Foundation (ASF) under one or more
-dnl contributor license agreements.  See the NOTICE file distributed with
-dnl this work for additional information regarding copyright ownership.
-dnl The ASF licenses this file to You under the Apache License, Version 2.0
-dnl (the "License"); you may not use this file except in compliance with
-dnl the License.  You may obtain a copy of the License at
-dnl
-dnl     http://www.apache.org/licenses/LICENSE-2.0
-dnl
-dnl Unless required by applicable law or agreed to in writing, software
-dnl distributed under the License is distributed on an "AS IS" BASIS,
-dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-dnl See the License for the specific language governing permissions and
-dnl limitations under the License.
-
-dnl
-dnl tcmalloc.m4: Trafficserver's tcmalloc autoconf macros
-dnl
-
-dnl This is kinda fugly, but need a way to both specify a directory and which
-dnl of the many tcmalloc libraries to use ...
-AC_DEFUN([TS_CHECK_TCMALLOC], [
-AC_ARG_WITH([tcmalloc-lib],
-  [AS_HELP_STRING([--with-tcmalloc-lib],[specify the tcmalloc library to use 
[default=tcmalloc]])],
-  [
-  with_tcmalloc_lib="$withval"
-  ],[
-  with_tcmalloc_lib="tcmalloc"
-  ]
-)
-
-has_tcmalloc=0
-AC_ARG_WITH([tcmalloc], [AS_HELP_STRING([--with-tcmalloc=DIR],[use the 
tcmalloc library])],
-[
-  if test "$withval" != "no"; then
-    if test "x${has_jemalloc}" = "xyes"; then
-      AC_MSG_ERROR([Cannot compile with both tcmalloc and jemalloc])
-    fi
-    if test "x${has_mimalloc}" = "xyes"; then
-      AC_MSG_ERROR([Cannot compile with both tcmalloc and mimalloc])
-    fi
-    tcmalloc_have_libs=0
-    if test "x$withval" != "xyes" && test "x$withval" != "x"; then
-      tcmalloc_ldflags="$withval/lib"
-      TS_ADDTO(LDFLAGS, [-L${tcmalloc_ldflags}])
-      TS_ADDTO_RPATH(${tcmalloc_ldflags})
-    fi
-    AC_SEARCH_LIBS([tc_cfree], ${with_tcmalloc_lib}, [tcmalloc_have_lib=1])
-    if test "$tcmalloc_have_lib" != "0"; then
-      has_tcmalloc=1
-    fi
-  fi
-])
-AC_SUBST(has_tcmalloc)
-])
diff --git a/cmake/FindTCMalloc.cmake b/cmake/FindTCMalloc.cmake
deleted file mode 100644
index 6b60072fc0..0000000000
--- a/cmake/FindTCMalloc.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-#######################
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
-#  agreements.  See the NOTICE file distributed with this work for additional 
information regarding
-#  copyright ownership.  The ASF licenses this file to you under the Apache 
License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with the 
License.  You may obtain
-#  a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software 
distributed under the License
-#  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
-#  or implied. See the License for the specific language governing permissions 
and limitations under
-#  the License.
-#
-#######################
-
-# FindTCMalloc.cmake
-#
-# This will define the following variables
-#
-#     TCMalloc_FOUND
-#     TCMalloc_LIBRARY
-#
-# and the following imported targets
-#
-#     TCMalloc::TCMalloc
-#
-
-# libtcmalloc.so symlink not created on OpenSUSE Leap 15.4
-find_library(TCMalloc_LIBRARY NAMES libtcmalloc libtcmalloc.so.4)
-
-mark_as_advanced(TCMalloc_FOUND TCMalloc_LIBRARY)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(TCMalloc REQUIRED_VARS TCMalloc_LIBRARY)
-
-if(TCMalloc_FOUND AND NOT TARGET TCMalloc::TCMalloc)
-    add_library(gperftools::TCMalloc INTERFACE IMPORTED)
-    target_link_libraries(gperftools::TCMalloc INTERFACE "${TCMalloc_LIBRARY}")
-endif()
diff --git a/cmake/FindTSMallocReplacement.cmake 
b/cmake/FindTSMallocReplacement.cmake
index 6ca2abfd5f..110a4f684d 100644
--- a/cmake/FindTSMallocReplacement.cmake
+++ b/cmake/FindTSMallocReplacement.cmake
@@ -23,7 +23,6 @@
 #     TS_HAS_MALLOC_REPLACEMENT
 #     TS_HAS_JEMALLOC
 #     TS_HAS_MIMALLOC
-#     TS_HAS_TCMALLOC
 #
 # and the following imported targets
 #
@@ -32,10 +31,6 @@
 
 if(ENABLE_JEMALLOC AND ENABLE_MIMALLOC)
     message(FATAL_ERROR "Cannot build with both jemalloc and mimalloc.")
-elseif(ENABLE_JEMALLOC AND ENABLE_TCMALLOC)
-    message(FATAL_ERROR "Cannot build with both jemalloc and TCMalloc.")
-elseif(ENABLE_MIMALLOC AND ENABLE_TCMALLOC)
-    message(FATAL_ERROR "Cannot build with both mimalloc and TCMalloc.")
 endif()
 
 if(ENABLE_JEMALLOC)
@@ -48,12 +43,7 @@ if(ENABLE_MIMALLOC)
 endif()
 set(TS_HAS_MIMALLOC ${mimalloc_FOUND})
 
-if(ENABLE_TCMALLOC)
-    find_package(TCMalloc REQUIRED)
-endif()
-set(TS_HAS_TCMALLOC ${TCMalloc_FOUND})
-
-if(TS_HAS_JEMALLOC OR TS_HAS_MIMALLOC OR TS_HAS_TCMALLOC)
+if(TS_HAS_JEMALLOC OR TS_HAS_MIMALLOC)
     set(TS_HAS_MALLOC_REPLACEMENT TRUE)
 endif()
 
@@ -62,7 +52,6 @@ mark_as_advanced(
     TS_HAS_MALLOC_REPLACEMENT
     TS_HAS_JEMALLOC
     TS_HAS_MIMALLOC
-    TS_HAS_TCMALLOC
 )
 
 include(FindPackageHandleStandardArgs)
@@ -83,10 +72,5 @@ if(TSMallocReplacement_FOUND AND NOT TARGET 
ts::TSMallocReplacement)
             INTERFACE
                 mimalloc::mimalloc
     )
-    elseif(TS_HAS_TCMALLOC)
-        target_link_libraries(ts::TSMallocReplacement
-            INTERFACE
-                gperftools::TCMalloc
-        )
     endif()
 endif()
diff --git a/configure.ac b/configure.ac
index 9103b7dfb9..e780703276 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1879,8 +1879,7 @@ AM_CONDITIONAL([HAS_WASM], [test "x${has_wasm}" = "x1" ])
 AM_CONDITIONAL([BUILD_HEALTHCHECK_PLUGIN], [ test "$ac_cv_func_inotify_init" = 
"yes" ])
 
 #
-# Check for tcmalloc, jemalloc and mimalloc
-TS_CHECK_TCMALLOC
+# Check for jemalloc and mimalloc
 TS_CHECK_JEMALLOC
 TS_CHECK_MIMALLOC
 
diff --git a/doc/developer-guide/testing/blackbox-testing.en.rst 
b/doc/developer-guide/testing/blackbox-testing.en.rst
index 8e500f0936..5bd7ef7754 100644
--- a/doc/developer-guide/testing/blackbox-testing.en.rst
+++ b/doc/developer-guide/testing/blackbox-testing.en.rst
@@ -237,7 +237,6 @@ Condition Testing
         - TS_HAS_LZMA
         - TS_HAS_PIPE_BUFFER_SIZE_CONFIG
         - TS_HAS_JEMALLOC
-        - TS_HAS_TCMALLOC
         - TS_HAS_MIMALLOC
         - TS_HAS_IN6_IS_ADDR_UNSPECIFIED
         - TS_HAS_BACKTRACE
diff --git a/include/tscore/ink_config.h.cmake.in 
b/include/tscore/ink_config.h.cmake.in
index e1a21d1782..56401d913a 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -118,7 +118,6 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_HAS_IN6_IS_ADDR_UNSPECIFIED
 #cmakedefine01 TS_HAS_IP_TOS
 #cmakedefine01 TS_HAS_JEMALLOC
-#cmakedefine01 TS_HAS_TCMALLOC
 #cmakedefine01 TS_HAS_PROFILER
 #cmakedefine01 TS_HAS_QUICHE
 #cmakedefine01 TS_HAS_SO_MARK
diff --git a/include/tscore/ink_config.h.in b/include/tscore/ink_config.h.in
index 8f3fedc90c..69574cc925 100644
--- a/include/tscore/ink_config.h.in
+++ b/include/tscore/ink_config.h.in
@@ -51,7 +51,6 @@
 
 /* Libraries */
 #define TS_HAS_JEMALLOC @jemalloch@
-#define TS_HAS_TCMALLOC @has_tcmalloc@
 #define TS_HAS_MIMALLOC @mimalloch@
 
 #define TS_USE_MALLOC_ALLOCATOR @enable_malloc_allocator@
diff --git a/src/traffic_layout/info.cc b/src/traffic_layout/info.cc
index dcd3a49e69..bb6d514cb4 100644
--- a/src/traffic_layout/info.cc
+++ b/src/traffic_layout/info.cc
@@ -93,7 +93,6 @@ produce_features(bool json)
   print_feature("TS_HAS_PIPE_BUFFER_SIZE_CONFIG", 0, json);
 #endif /* F_GETPIPE_SZ */
   print_feature("TS_HAS_JEMALLOC", TS_HAS_JEMALLOC, json);
-  print_feature("TS_HAS_TCMALLOC", TS_HAS_TCMALLOC, json);
   print_feature("TS_HAS_IN6_IS_ADDR_UNSPECIFIED", 
TS_HAS_IN6_IS_ADDR_UNSPECIFIED, json);
   print_feature("TS_HAS_BACKTRACE", TS_HAS_BACKTRACE, json);
   print_feature("TS_HAS_PROFILER", TS_HAS_PROFILER, json);
diff --git a/tests/README.md b/tests/README.md
index fdb89a4d16..3f732b8dcc 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -332,7 +332,6 @@ ts.Disk.remap_config.AddLine(
  * TS_HAS_LZMA
  * TS_HAS_PIPE_BUFFER_SIZE_CONFIG
  * TS_HAS_JEMALLOC
- * TS_HAS_TCMALLOC
  * TS_HAS_MIMALLOC
  * TS_HAS_IN6_IS_ADDR_UNSPECIFIED
  * TS_HAS_BACKTRACE

Reply via email to