~brianaker/memcached/1.4

Viewing all changes in revision 1376.

  • Committer: dormando
  • Date: 2018-02-12 23:08:51 UTC
  • Revision ID: git-v1:5c0face158f1d0f9c6add22b8f027e468bbe5368
remove redundant counter/lock from hash table

curr_items tracks how many items are linked in the hash table. internally to
the hash table, hash_items tracked how many items were in the hash table.

on every insert/delete, hash_items had to be locked and checked to see if th
table should be expanded. rip that all out, and call a check with the
once-per-second clock event to check for hash table expansion.

this actually ends up fixing an obscure bug: if you burst a bunch of sets
then stop, the hash table won't attempt to expand a second time until the
next insert. with this change, every second the hash table has a chance of
expanding again.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: