xo-arena: verify SM3.2 in DArenaHashMap.verify_ok
This commit is contained in:
parent
3049492de8
commit
29fb1b20f5
1 changed files with 17 additions and 0 deletions
|
|
@ -495,6 +495,23 @@ namespace xo {
|
|||
}
|
||||
}
|
||||
|
||||
/* SM3.2: {number of control_[i] spots with non-sentinel values} = size_ */
|
||||
{
|
||||
size_type occupied_count = 0;
|
||||
for (size_type i = 0; i < n_slot_; ++i) {
|
||||
uint8_t c = control_[i];
|
||||
if ((c != c_empty_slot) && (c != c_tombstone)) {
|
||||
++occupied_count;
|
||||
}
|
||||
}
|
||||
if (occupied_count != size_) {
|
||||
return policy.report_error(log,
|
||||
c_self, ": expect occupied control count = size",
|
||||
xtag("occupied_count", occupied_count),
|
||||
xtag("size", size_));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue