3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 00:26:38 +00:00

new hashtable invariants

This commit is contained in:
Chuyue Sun 2024-07-18 22:55:06 +00:00
parent 3b43f27580
commit f38527124b

View file

@ -639,6 +639,19 @@ public:
#ifdef Z3DEBUG
bool check_invariant() {
// The capacity must always be a power of two.
if (!is_power_of_two(m_capacity))
return false;
// The number of deleted plus the size must not exceed the capacity.
if (m_num_deleted + m_size > m_capacity)
return false;
// Checking that m_num_deleted is less than or equal to m_size.
if (m_num_deleted > m_size) {
return false;
}
entry * curr = m_table;
entry * end = m_table + m_capacity;
unsigned num_deleted = 0;