summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-08-18 09:19:53 -0700
committerEric Anholt <eric@anholt.net>2011-08-18 09:25:27 -0700
commit391a6c0aefab18eacb83456b3bcb161cc7371773 (patch)
tree35b93476b4b0bc1c1fed921a3ead8b6c381b51f0 /README
parent1bb8bdb4653e9b05706901fe01012eb170ee0500 (diff)
Add defined behavior for inserts with matching keys, and a test.
Diffstat (limited to 'README')
-rw-r--r--README6
1 files changed, 4 insertions, 2 deletions
diff --git a/README b/README
index be2fe40..fb85a68 100644
--- a/README
+++ b/README
@@ -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