]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix estimate of bitmask type 15038/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 14 Jan 2025 13:13:42 +0000 (14:13 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 14 Jan 2025 13:13:42 +0000 (14:13 +0100)
pdns/dnsrecords.hh

index b5239b68fadfa4bc7ec581c50a61589ad28e1325..1913bfa501983c9c76ac5eb64bf2e30f0b9f3065 100644 (file)
@@ -852,7 +852,10 @@ public:
 
   [[nodiscard]] size_t sizeEstimate() const
   {
-    return  d_bitset ? nbTypes / 8 : d_set.size() * (2U + sizeof(std::set<uint16_t>)); // XXX
+    // for tree: size() nodes of roughly the size of the head node (very rough estimate as tree
+    // implementations can vary wildly on how they represent nodes of the tree, but we cannot access
+    // that private info)
+    return d_bitset ? nbTypes / 8 : d_set.size() * sizeof(std::set<uint16_t>);
   }
 
 private: