CVSROOT:        /cvs
Module name:    src
Changes by:     js...@cvs.openbsd.org   2024/01/24 07:02:52

Modified files:
        lib/libcrypto/lhash: lhash.c 
        lib/libcrypto/man: lh_new.3 

Log message:
Make it safe to delete entries from an lhash doall callback.

Currently, the callback cannot safely delete entries as it could lead to
contraction of the hash table, which in turn could lead to doall skipping
entries (and that typically leads to memory leaks). The recommended
workaround is to reach in and fiddle with the hash table internals in
order to prevent contraction, call the doall function and then restore
the internals that were changed.

Rather than just improving our documentation, actually make it safe to
delete entries from an lhash doall callback by pausing contractions prior
to starting the callback loop, then restoring the down load factor and
triggering contraction once completed. This means that callers no longer
need access to change hash table internals in order to achieve this same
behaviour.

ok tb@

Reply via email to