• Jim Brunner's avatar
    dict: pause rehash, minor readability refactor (#8515) · 06966d2a
    Jim Brunner authored
    The `dict` field `iterators` is misleading and incorrect. 
    This variable is used for 1 purpose - to pause rehashing.
    
    The current `iterators` field doesn't actually count "iterators".
    It counts "safe iterators".  But - it doesn't actually count safe iterators
    either.  For one, it's only incremented once the safe iterator begins to
    iterate, not when it's created.  It's also incremented in `dictScan` to
    prevent rehashing (and commented to make it clear why `iterators` is
    being incremented during a scan).
    
    This update renames the field as `pauserehash` and creates 2 helper
    macros `dictPauseRehashing(d)` and `dictResumeRehashing(d)`
    06966d2a
dict.h 7.63 KB