From 0740dcad436eb174aa1234ee2767fec1e8ccd9f3 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Wed, 14 Aug 2024 14:28:28 -0700 Subject: [PATCH] Strengthen checkMemoryBoundInvariants check for Node0 I think this is probably checked elsewhere, but let's check here too for consistency --- ConflictSet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index f737141..7078e58 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -524,6 +524,8 @@ std::string getSearchPath(Node *n); // Induction hypothesis is that each node's surplus is >= kMinNodeSurplus constexpr int kBytesPerKey = 112; constexpr int kMinNodeSurplus = 80; +// Cound the entry itself as a child +constexpr int kMinChildrenNode0 = 1; constexpr int kMinChildrenNode3 = 2; constexpr int kMinChildrenNode16 = 4; constexpr int kMinChildrenNode48 = 17; @@ -3886,7 +3888,7 @@ checkMaxVersion(Node *root, Node *node, InternalVersionT oldestVersion, int minNumChildren; switch (node->getType()) { case Type_Node0: - minNumChildren = 0; + minNumChildren = kMinChildrenNode0; break; case Type_Node3: minNumChildren = kMinChildrenNode3;