]> 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@sury.org>
Wed, 5 Mar 2025 06:55:50 +0000 (07:55 +0100)
commit55f63a99f39a5336e564bf52c0e5ea49f1f0c280
tree2ce288a5b50d46d373555cff12b85ab41f77a4d8
parentda76fce7cd585239eeed77fda3b5ef705ce490ab
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