# use existing cstr_hash, key_value # include actual hash value in table? I think so, especially as we are using a # flat one. Can help with rehash and end markers too. On the other hand this # means we now need 4 words per single entry (2 for entry, 2 for end marker). # So no! I'll do it in the hope that the table will be largely empty, without # hash values in the table. # how to mark the end of a series? # - can require pointers (values) to be 0 % 4 (4 bytes aligned) ? # simple: each entry is a key-value pair, so put those pairs directly in the # hash table. An 'end' marker has key == NULL, and value == (void*)hash_value. # An empty cell has key == NULL and value == NULL (also a sign that reached the # end of the chain?) # or, just let 'empty' be the sign that we've reached the end of the chain? # Not sure. Could try it both ways and benchmark. Compare with a trie, too. # problem with 'empty' as end of chain, it costs more to delete a key since # have to fill with something other than 'empty'. # empty can be {0, 0} deleted can be {0, 1} ? # For now, to make it even simpler, I will exclude the possibility to delete. # Delete is rare anyway. # seems simple, I'll go with that first # When to 'double' the hash table? note: MUST have prime size for the skipping # to work right, so we need a list of doubling primes.