mirror of
https://github.com/openssl/openssl.git
synced 2025-03-07 19:38:33 +08:00
Revert lhash patch for PR#2124
This commit is contained in:
parent
b41a614686
commit
941baf6641
@ -310,40 +310,16 @@ void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg)
|
|||||||
static void expand(_LHASH *lh)
|
static void expand(_LHASH *lh)
|
||||||
{
|
{
|
||||||
LHASH_NODE **n,**n1,**n2,*np;
|
LHASH_NODE **n,**n1,**n2,*np;
|
||||||
unsigned int p,i,j,pmax;
|
unsigned int p,i,j;
|
||||||
unsigned long hash,nni;
|
unsigned long hash,nni;
|
||||||
|
|
||||||
p=(int)lh->p++;
|
|
||||||
nni=lh->num_alloc_nodes;
|
|
||||||
pmax=lh->pmax;
|
|
||||||
|
|
||||||
if ((lh->p) >= lh->pmax)
|
|
||||||
{
|
|
||||||
j=(int)lh->num_alloc_nodes*2;
|
|
||||||
n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
|
|
||||||
(int)sizeof(LHASH_NODE *)*j);
|
|
||||||
if (n == NULL)
|
|
||||||
{
|
|
||||||
/* fputs("realloc error in lhash",stderr); */
|
|
||||||
lh->error++;
|
|
||||||
lh->p=0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* else */
|
|
||||||
for (i=(int)lh->num_alloc_nodes; i<j; i++)/* 26/02/92 eay */
|
|
||||||
n[i]=NULL; /* 02/03/92 eay */
|
|
||||||
lh->pmax=lh->num_alloc_nodes;
|
|
||||||
lh->num_alloc_nodes=j;
|
|
||||||
lh->num_expand_reallocs++;
|
|
||||||
lh->p=0;
|
|
||||||
lh->b=n;
|
|
||||||
}
|
|
||||||
|
|
||||||
lh->num_nodes++;
|
lh->num_nodes++;
|
||||||
lh->num_expands++;
|
lh->num_expands++;
|
||||||
|
p=(int)lh->p++;
|
||||||
n1= &(lh->b[p]);
|
n1= &(lh->b[p]);
|
||||||
n2= &(lh->b[p+pmax]);
|
n2= &(lh->b[p+(int)lh->pmax]);
|
||||||
*n2=NULL; /* 27/07/92 - eay - undefined pointer bug */
|
*n2=NULL; /* 27/07/92 - eay - undefined pointer bug */
|
||||||
|
nni=lh->num_alloc_nodes;
|
||||||
|
|
||||||
for (np= *n1; np != NULL; )
|
for (np= *n1; np != NULL; )
|
||||||
{
|
{
|
||||||
@ -412,7 +388,6 @@ static void contract(_LHASH *lh)
|
|||||||
else
|
else
|
||||||
lh->p--;
|
lh->p--;
|
||||||
|
|
||||||
lh->b[idx] = NULL;
|
|
||||||
lh->num_nodes--;
|
lh->num_nodes--;
|
||||||
lh->num_contracts++;
|
lh->num_contracts++;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user