From c813f1464ce8ad98d45a6a132499247251e15d96 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Tue, 23 Feb 2016 15:29:58 +0100 Subject: Add support for tcmalloc Beside improving performance of KLEE, tcmalloc allows to track used memory correctly. If available, tcmalloc is automatically used during compile time. This can be forced to be: - disabled using --without-tcmalloc - enabled using --with-tcmalloc In the second case, configure will fail if tcmalloc is not found or usable. Both versions of tcmalloc a minimal and normal version. --- autoconf/configure.ac | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'autoconf/configure.ac') diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 617469e6..bb391329 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -549,6 +549,41 @@ AC_CHECK_FUNCS([malloc_zone_statistics]) AC_SEARCH_LIBS(mallinfo,malloc, AC_DEFINE([HAVE_MALLINFO],[1],[Define if mallinfo() is available on this platform.])) +dnl ************************************************************************** +dnl Test for tcmalloc +dnl ************************************************************************** + +AC_ARG_WITH([tcmalloc], + AS_HELP_STRING([--without-tcmalloc], [Ignore presence of tcmalloc and disable it (default=detect)])) + +AS_IF([test "x$with_tcmalloc" != "xno"], + AC_CHECK_HEADERS([gperftools/malloc_extension.h], + [have_tcmalloc=yes], [have_tcmalloc=no]), + [have_tcmalloc=no]) + +AS_IF([test "x$have_tcmalloc" = "xyes"], + [ + AC_SEARCH_LIBS(tc_malloc,tcmalloc_minimal, + [ + AC_SUBST(HAVE_TCMALLOC, 1) + if test "${ac_cv_search_tc_malloc}" != "none required"; then + TCMALLOC_LIB=${ac_cv_search_tc_malloc} + AC_SUBST(TCMALLOC_LIB) + fi + ], + [ + AC_MSG_WARN([Could not link with tcmalloc]) + AC_SUBST(HAVE_TCMALLOC, 0) + ],) + + ], + [AS_IF([test "x$with_tcmalloc" = "xyes"], + [AC_MSG_ERROR([tcmalloc requested but not found])], + [ + AC_SUBST(HAVE_TCMALLOC, 0) + ]) +]) + dnl ************************************************************************** dnl Find an install of STP dnl ************************************************************************** -- cgit 1.4.1