]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Compile with jemalloc to reduce memory allocator contention
authorOndřej Surý <ondrej@sury.org>
Tue, 11 May 2021 10:29:57 +0000 (12:29 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 9 Jul 2021 13:58:02 +0000 (15:58 +0200)
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.

configure.ac
lib/isc/Makefile.am

index 03fd0b2725e5bfe7ae3c552f6a6ffc0ddddded65..7ada1b61eed9efbc17fd24de66d23c91aebfc8ab 100644 (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?
 #
index deed17c9a9cc0b4f4ba8995992c52b4a2b324e40..1b5898817bf4d1ffa7a5832a57b2454f1b1bec5f 100644 (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)