]> git.ipfire.org Git - thirdparty/bind9.git/commit
Replace attach/detach in isc_mem with refcount implementation
authorOndřej Surý <ondrej@isc.org>
Mon, 9 Sep 2024 10:14:05 +0000 (12:14 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 5 Mar 2025 10:17:17 +0000 (11:17 +0100)
commiteab9fc22e70041e1d8954bef9fd5e61e4948b269
tree73f9b6f703e1c436e43c17e0e140f6a9a991102e
parent552cf64a706c2bfe8bfc075694e2a7d5a8fd4758
Replace attach/detach in isc_mem with refcount implementation

The isc_mem API is one of the most commonly used APIs that didn't
used ISC_REFCOUNT_DECL and ISC_REFCOUNT_IMPL macros.  Replace the
implementation of isc_mem_attach(), isc_mem_detach() and
isc_mem_destroy() with the respective macros.

This also removes the legacy isc_mem_destroy() functionality that would
check whether all references had been detached from the memory context
as it doesn't work reliably when using the call_rcu() API.  Instead of
doing this individually, call isc_mem_checkdestroyed(stderr) from the
isc_mem_destroy() macro to keep the extra check that all contexts were
freed when the program is exiting.
lib/isc/include/isc/mem.h
lib/isc/mem.c