From: Alessio Podda Date: Thu, 14 Aug 2025 10:10:21 +0000 (+0000) Subject: chg: dev: Split dbmethods into node and db vtable X-Git-Tag: v9.21.12~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b084f8387fda655a82b2bb8352000b80ce662685;p=thirdparty%2Fbind9.git chg: dev: Split dbmethods into node and db vtable All databases in the codebase follow the same structure: a database is an associative container from DNS names to nodes, and each node is an associative container from RR types to RR data. Each database implementation (qpzone, qpcache, sdlz, builtin, dyndb) has its own corresponding node type (qpznode, qpcnode, etc). However, some code needs to work with nodes generically regardless of their specific type - for example, to acquire locks, manage references, or register/unregister slabs from the heap. Before this MR, these generic node operations were implemented as methods in a `dns_dbmethods_t` vtable. This created a coupling between the database and node lifetimes. If a node were to outlive its parent database, the node destructor would destroy all RR data, and each RR data destructor would try to unregister from heaps by calling a virtual function from the database vtable. Since the database was already freed, this would cause a crash. This MR breaks the coupling by standardizing the layout of all database nodes, adding a `dns_dbnode_methods_t` vtable for node operations, and moving node-specific methods from the database vtable to the node vtable. Merge branch 'alessio/dbnode-vtable' into 'main' See merge request isc-projects/bind9!10728 --- b084f8387fda655a82b2bb8352000b80ce662685