+ void gather_level_statistics(std::vector<feldman_hashset::level_statistics>& stat, size_t nLevel, array_node * pArr, size_t nSize) const
+ {
+ if (stat.size() <= nLevel) {
+ stat.resize(nLevel + 1);
+ stat[nLevel].node_capacity = nSize;
+ }
+
+ ++stat[nLevel].array_node_count;
+ for (atomic_node_ptr * p = pArr->nodes, *pLast = pArr->nodes + nSize; p != pLast; ++p) {
+ node_ptr slot = p->load(memory_model::memory_order_relaxed);
+ if (slot.bits() == flag_array_node) {
+ ++stat[nLevel].array_cell_count;
+ gather_level_statistics(stat, nLevel + 1, to_array(slot.ptr()), array_node_size());
+ }
+ else if (slot.bits() == flag_array_converting)
+ ++stat[nLevel].array_cell_count;
+ else if (slot.ptr())
+ ++stat[nLevel].data_cell_count;
+ else
+ ++stat[nLevel].empty_cell_count;
+ }
+ }
+