mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
(rehash_after_gc): Bug fix: properly link the processed hashtables
back into the weak_hashtables list. Thanks to Bill Schottstaedt!
This commit is contained in:
parent
e7313a9d7e
commit
e0245b20cb
1 changed files with 3 additions and 2 deletions
|
@ -268,10 +268,11 @@ rehash_after_gc (void *dummy1 SCM_UNUSED,
|
|||
{
|
||||
if (!SCM_NULLP (to_rehash))
|
||||
{
|
||||
SCM h = to_rehash, last;
|
||||
SCM first = to_rehash, last, h;
|
||||
/* important to clear to_rehash here so that we don't get stuck
|
||||
in an infinite loop if scm_i_rehash causes GC */
|
||||
to_rehash = SCM_EOL;
|
||||
h = first;
|
||||
do
|
||||
{
|
||||
scm_i_rehash (h,
|
||||
|
@ -284,7 +285,7 @@ rehash_after_gc (void *dummy1 SCM_UNUSED,
|
|||
} while (!SCM_NULLP (h));
|
||||
/* move tables back to weak_hashtables */
|
||||
SCM_SET_HASHTABLE_NEXT (last, weak_hashtables);
|
||||
weak_hashtables = to_rehash;
|
||||
weak_hashtables = first;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue