]> git.ipfire.org Git - thirdparty/bind9.git/commit
Handle ISC_MEM_DEFAULTFILL consistently
authorMichał Kępień <michal@isc.org>
Fri, 15 Jul 2022 08:23:03 +0000 (10:23 +0200)
committerMichał Kępień <michal@isc.org>
Fri, 15 Jul 2022 08:45:34 +0000 (10:45 +0200)
commit4d1986ebcb1c120b226ce3c78cffa498d532b849
tree239a14ff58da13b84cb2f7a99cc335d0b722675a
parent7df6070c02299ce6b1bbc8c7104371d45df58fd5
Handle ISC_MEM_DEFAULTFILL consistently

Contrary to what the documentation states, memory filling is only
enabled by --enable-developer (or by setting -DISC_MEM_DEFAULTFILL=1) if
the internal memory allocator is used.  However, the internal memory
allocator is disabled by default, so just using the --enable-developer
build-time option does not enable memory filling (passing "-M fill" on
the named command line is necessary to actually enable it).  As memory
filling is a useful tool for troubleshooting certain types of bugs, it
should also be enabled by --enable-developer when the system allocator
is used.

Furthermore, memory-related preprocessor macros are handled in two
distinct locations: lib/isc/include/isc/mem.h and bin/named/main.c.
This makes the logic hard to follow.

Move all code handling the ISC_MEM_DEFAULTFILL preprocessor macro to
lib/isc/include/isc/mem.h, ensuring memory filling is enabled by the
--enable-developer build-time switch, no matter which memory allocator
is used.
bin/named/main.c
lib/isc/include/isc/mem.h