Compile with jemalloc to reduce memory allocator contention

The jemalloc allocator is scalable high performance allocator, this is
the first in the series of commits that will add jemalloc as a memory
allocator for BIND 9.

This commit adds configure.ac check and Makefile modifications to use
jemalloc as BIND 9 allocator.
This commit is contained in:
Ondřej Surý
2021-05-11 12:29:57 +02:00
parent 63924968d1
commit 7f1c525625
2 changed files with 13 additions and 0 deletions

View File

@@ -1376,6 +1376,17 @@ AC_SUBST([CMOCKA_LIBS])
AM_CONDITIONAL([HAVE_CMOCKA], [test "$with_cmocka" = "yes"])
#
#
#
AC_MSG_CHECKING([for jemalloc])
PKG_CHECK_MODULES([JEMALLOC], [jemalloc >= 5], []
[AC_MSG_WARN([Using jemalloc 5 is recommended])
PKG_CHECK_MODULES([JEMALLOC], [jemalloc], [],
[AC_MSG_ERROR([jemalloc not found])])])
AC_SUBST([JEMALLOC_CFLAGS])
AC_SUBST([JEMALLOC_LIBS])
#
# was --with-tuning specified?
#

View File

@@ -230,6 +230,7 @@ libisc_la_SOURCES = \
libisc_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(JEMALLOC_CPPFLAGS) \
$(LIBISC_CFLAGS) \
$(LIBUV_CFLAGS) \
$(OPENSSL_CFLAGS) \
@@ -240,6 +241,7 @@ libisc_la_LDFLAGS = \
-release "$(PACKAGE_VERSION)"
libisc_la_LIBADD = \
$(JEMALLOC_LIBS) \
$(LIBUV_LIBS) \
$(OPENSSL_LIBS) \
$(ZLIB_LIBS)