summaryrefslogtreecommitdiffhomepage
path: root/src/orderedmap.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2021-03-14 01:06:35 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2021-03-14 01:57:21 +0000
commit38934921c4d6801ebdc13d32b4238c4a2ffa9c98 (patch)
tree519bcfb7c987c948b095e54850c23e42e21ca98b /src/orderedmap.c
parent4147e917d610f793ec14f7bf4ffc82c3b4c92dab (diff)
htab_delete(): fix failure to set tombstone
we can't just set an item's key to zero and be done with a deletion, because this will break the item search chain. a deleted item requires a special marker, also known as tombstone. when searching for an item, all slots with a tombstone need to treated as if they were in use, but when inserting an item such a slot needs to be filled with the new item. a common procedure is to rehash the table when the number of deleted items crosses a certain threshold, though for simplicity we leave this task to the resize() function which does the same thing anyway when the hashtable grows. this allows to fix the issue quite elegantly and with almost no additional overhead, so we don't penalize applications that do very few deletions.
Diffstat (limited to 'src/orderedmap.c')
0 files changed, 0 insertions, 0 deletions