summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/obj_dat.c
diff options
context:
space:
mode:
authorjsing <>2024-01-24 14:02:52 +0000
committerjsing <>2024-01-24 14:02:52 +0000
commit8cf7a8d06866dd151552f63a2f8bf289d3e48683 (patch)
tree23db63fc3b4137172ed05920d323daacd2d92049 /src/lib/libcrypto/objects/obj_dat.c
parent304c4bea814902359fc956dde611b1bf4fe6c276 (diff)
downloadopenbsd-8cf7a8d06866dd151552f63a2f8bf289d3e48683.tar.gz
openbsd-8cf7a8d06866dd151552f63a2f8bf289d3e48683.tar.bz2
openbsd-8cf7a8d06866dd151552f63a2f8bf289d3e48683.zip
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@
Diffstat (limited to 'src/lib/libcrypto/objects/obj_dat.c')
0 files changed, 0 insertions, 0 deletions