sync with OpenBSD -current

This commit is contained in:
purplerain 2024-05-06 16:20:26 +00:00
parent f05839c6d3
commit a6677bfd36
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
29 changed files with 703 additions and 123 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: lhash.c,v 1.22 2024/03/02 11:11:11 tb Exp $ */
/* $OpenBSD: lhash.c,v 1.24 2024/05/06 14:38:20 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -294,7 +294,9 @@ doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
/* Restore down load factor and trigger contraction. */
lh->down_load = down_load;
contract(lh);
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
}
void
@ -397,7 +399,8 @@ contract(_LHASH *lh)
}
}
static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash)
static LHASH_NODE **
getrn(_LHASH *lh, const void *data, unsigned long *rhash)
{
LHASH_NODE **ret, *n1;
unsigned long hash, nn;