From 3391c60f424689c3f739acdf67081cbe32ab4333 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 14 Jan 2025 14:13:42 +0100 Subject: [PATCH] Fix estimate of bitmask type --- pdns/dnsrecords.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index b5239b68fa..1913bfa501 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -852,7 +852,10 @@ public: [[nodiscard]] size_t sizeEstimate() const { - return d_bitset ? nbTypes / 8 : d_set.size() * (2U + sizeof(std::set)); // 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); } private: -- 2.47.2