Skip to content

Commit

Permalink
added macro that defines what malloc system to use
Browse files Browse the repository at this point in the history
  • Loading branch information
syegres committed Feb 16, 2014
1 parent 567dc0e commit 80a9212
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
22 changes: 22 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -19455,12 +19455,34 @@ if test "x$ac_cv_lib_tcmalloc_malloc" = xyes; then :
fi



$as_echo "#define MALLOC_TBB 1" >>confdefs.h


$as_echo "#define MALLOC_TCMALLOC 2" >>confdefs.h


$as_echo "#define MALLOC_STD 3" >>confdefs.h


$as_echo "#define MALLOC_SYSTEM MALLOC_STD" >>confdefs.h


if test "$have_tbb" = yes && test x$usetbbmalloc = xyes; then
LIBS="$LIBS -ltbbmalloc -ltbbmalloc_proxy"

$as_echo "#define MALLOC_SYSTEM MALLOC_TBB" >>confdefs.h

else if test "$have_tcmalloc_minimal_lib" = yes && test x$usetcmalloc = xyes; then
LIBS="$LIBS -ltcmalloc_minimal"

$as_echo "#define MALLOC_SYSTEM MALLOC_TCMALLOC" >>confdefs.h

else if test "$have_tcmalloc_lib" = yes && test x$usetcmalloc = xyes; then
LIBS="$LIBS -ltcmalloc"

$as_echo "#define MALLOC_SYSTEM MALLOC_TCMALLOC" >>confdefs.h

fi
fi
fi
Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,20 @@ AM_CONDITIONAL(TBBSUPPORT, [test x$have_tbb = xyes])
AC_CHECK_LIB(tcmalloc_minimal, malloc, have_tcmalloc_minimal_lib=yes)
AC_CHECK_LIB(tcmalloc, malloc, have_tcmalloc_lib=yes)

AC_DEFINE(MALLOC_TBB, 1, [TBB malloc])
AC_DEFINE(MALLOC_TCMALLOC, 2, [tcmalloc])
AC_DEFINE(MALLOC_STD, 3, [std malloc])
AC_DEFINE(MALLOC_SYSTEM, MALLOC_STD, [malloc system to use])

if test "$have_tbb" = yes && test x$usetbbmalloc = xyes; then
LIBS="$LIBS -ltbbmalloc -ltbbmalloc_proxy"
AC_DEFINE(MALLOC_SYSTEM, MALLOC_TBB, [malloc system to use])
else if test "$have_tcmalloc_minimal_lib" = yes && test x$usetcmalloc = xyes; then
LIBS="$LIBS -ltcmalloc_minimal"
AC_DEFINE(MALLOC_SYSTEM, MALLOC_TCMALLOC, [malloc system to use])
else if test "$have_tcmalloc_lib" = yes && test x$usetcmalloc = xyes; then
LIBS="$LIBS -ltcmalloc"
AC_DEFINE(MALLOC_SYSTEM, MALLOC_TCMALLOC, [malloc system to use])
fi
fi
fi
Expand Down
10 changes: 5 additions & 5 deletions msvc/f8config_msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,14 @@ HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
/* tbb thread thread system */
#define THREAD_TBB 3

/* std malloc */
#define MALLOC_STD 1

/* tbb malloc */
#define MALLOC_TBB 2
#define MALLOC_TBB 1

/* tc malloc */
#define MALLOC_TC 3
#define MALLOC_TCMALLOC 2

/* std malloc */
#define MALLOC_STD 3

/* malloc system to use */
#define MALLOC_SYSTEM MALLOC_TBB
Expand Down

0 comments on commit 80a9212

Please sign in to comment.