From: Otto Moerbeek Date: Tue, 14 Jan 2025 13:13:42 +0000 (+0100) Subject: Fix estimate of bitmask type X-Git-Tag: dnsdist-2.0.0-alpha1~163^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3391c60f424689c3f739acdf67081cbe32ab4333;p=thirdparty%2Fpdns.git Fix estimate of bitmask type --- 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: