diff options
author | Eric Anholt <eric@anholt.net> | 2011-08-18 09:19:53 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-08-18 09:25:27 -0700 |
commit | 391a6c0aefab18eacb83456b3bcb161cc7371773 (patch) | |
tree | 35b93476b4b0bc1c1fed921a3ead8b6c381b51f0 /README | |
parent | 1bb8bdb4653e9b05706901fe01012eb170ee0500 (diff) |
Add defined behavior for inserts with matching keys, and a test.
Diffstat (limited to 'README')
-rw-r--r-- | README | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -13,8 +13,10 @@ with rehashing. The table stores for each entry: * pointer to the data. Inserts occur at key->hash % hash->size. When an insert collides, the insert -reattempts at (key->hash % hash->size + hash->reprobe) % hash->size, and -onwards at increments of reprobe until a free or dead entry is found. +steps through the table using the reprobe stride until a free or dead entry is +found. When an insert occurs with a key matching a key already in the table, +the new data is associated with the key. Note that old key/data is not freed, +so if memory management is required, do a search before insert. When searching, the search starts at key % hash_size and continues at increments of reprobe as with inserts, until the matching entry or an |