• Allison Karlitskaya's avatar
    ghash: fix small array handling in g_hash_table_remove_all_nodes() · 11503333
    Allison Karlitskaya authored
    Factor out the code for setting up the hash table size, mask and mod,
    detecting valgrind and allocating the arrays for hashes, keys, and
    Make use of this new function from g_hash_table_remove_all_nodes().
    The handling of have_big_keys and have_big_values was never correct in
    this function because it reallocated the array without changing the
    flags in the struct.  Any calls in to the hashtable from destroy
    notifies would find the table in an inconsistent state.
    Many thanks to Thomas Haller who is essentially responsible for all the
    real work in this patch: both discovering and identifying the original
    problem, as well as finding the solution to it.
ghash.c 76 KB