]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use system allocator when jemalloc is unavailable
authorOndřej Surý <ondrej@sury.org>
Tue, 25 May 2021 10:46:00 +0000 (12:46 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 9 Jul 2021 13:58:02 +0000 (15:58 +0200)
commite20cc41e56905fbd32c7824f7cf8bdf6a5db6d1c
tree2781fb995bc309796818b369021bde8e5ac99656
parent68a28cbc0aeb3a613b0f15e3d7f8484490ae89ee
Use system allocator when jemalloc is unavailable

This commit adds support for systems where the jemalloc library is not
available as a package, here's the quick summary:

  * On Linux - the jemalloc is usually available as a package, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_usable_size()

  * On macOS - the jemalloc is available from homebrew or macports, if
    configured --without-jemalloc, the shim would be used around
    malloc(), free(), realloc() and malloc_size()

  * On FreeBSD - the jemalloc is *the* system allocator, we just need
    to check for <malloc_np.h> header to get access to non-standard API

  * On NetBSD - the jemalloc is *the* system allocator, we just need to
    check for <jemalloc/jemalloc.h> header to get access to non-standard
    API

  * On a system hostile to users and developers (read OpenBSD) - the
    jemalloc API is emulated by using ((size_t *)ptr)[-1] field to hold
    the size information.  The OpenBSD developers care only for
    themselves, so why should we care about speed on OpenBSD?
configure.ac
lib/isc/Makefile.am
lib/isc/jemalloc_shim.h [new file with mode: 0644]
lib/isc/mem.c
m4/ax_jemalloc.m4 [new file with mode: 0644]
util/copyrights