Index: src/misc/hashtable.hpp =================================================================== --- src/misc/hashtable.hpp (revision 27993) +++ src/misc/hashtable.hpp (working copy) @@ -256,6 +256,25 @@ slot.Attach(new_item); m_num_items++; } + + ~CHashTableT() + { + static bool dumped = false; + if (!dumped && m_num_items > 3000) { + const char *path = "/tmp/hashdump.txt"; + FILE *f = fopen(path, "w"); + fprintf(f, "%d items in %d slots\n", m_num_items, (1 << Thash_bits)); + for (int i = 0; i < (1 << Thash_bits); i++) { + Titem *p = m_slots[i].m_pFirst; + int j = 0; + while (p) { j++; p = p->GetHashNext(); } + fprintf(f, "%d\t%d\n", i, j); + } + fclose(f); + fprintf(stderr, "[hash] wrote %s\n", path); + dumped = true; + } + } }; #endif /* HASHTABLE_HPP */