* hashtab.c (htab_expand): Fix allocation of new entries.
From-SVN: r61507
This commit is contained in:
parent
5794139ae9
commit
120cdf68d5
@ -1,3 +1,7 @@
|
|||||||
|
2003-01-20 Josef Zlomek <zlomekj@suse.cz>
|
||||||
|
|
||||||
|
* hashtab.c (htab_expand): Fix allocation of new entries.
|
||||||
|
|
||||||
2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
|
2003-01-09 Christian Cornelssen <ccorn@cs.tu-berlin.de>
|
||||||
|
|
||||||
* Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR.
|
* Makefile.in (FLAGS_TO_PASS): Also pass DESTDIR.
|
||||||
|
@ -306,16 +306,18 @@ htab_expand (htab)
|
|||||||
PTR *olimit;
|
PTR *olimit;
|
||||||
PTR *p;
|
PTR *p;
|
||||||
PTR *nentries;
|
PTR *nentries;
|
||||||
|
size_t nsize;
|
||||||
|
|
||||||
oentries = htab->entries;
|
oentries = htab->entries;
|
||||||
olimit = oentries + htab->size;
|
olimit = oentries + htab->size;
|
||||||
|
|
||||||
htab->size = higher_prime_number (htab->size * 2);
|
nsize = higher_prime_number (htab->size * 2);
|
||||||
|
|
||||||
nentries = (PTR *) (*htab->alloc_f) (htab->size, sizeof (PTR *));
|
nentries = (PTR *) (*htab->alloc_f) (nsize, sizeof (PTR));
|
||||||
if (nentries == NULL)
|
if (nentries == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
htab->entries = nentries;
|
htab->entries = nentries;
|
||||||
|
htab->size = nsize;
|
||||||
|
|
||||||
htab->n_elements -= htab->n_deleted;
|
htab->n_elements -= htab->n_deleted;
|
||||||
htab->n_deleted = 0;
|
htab->n_deleted = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user