1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Ensure weak sets are occasionally vacuumed.

Just like in dc8dda77e0, this ensures weak
sets are vacuumed in a timely fashion.  It also works around the fact
that 'vacuum_all_weak_tables' isn't getting called more than a couple of
times, for some reason.

Partly fixes <https://bugs.gnu.org/40194>.

* libguile/weak-set.c (weak_set_add_x): When 'set->items > set->upper',
call 'vacuum_weak_set'.
This commit is contained in:
Ludovic Courtès 2020-03-23 21:36:09 +01:00
parent 168ad279e6
commit 02e3dc6ab9

View file

@ -563,6 +563,7 @@ weak_set_add_x (scm_t_weak_set *set, unsigned long hash,
if (set->n_items > set->upper)
/* Full set, time to resize. */
{
vacuum_weak_set (set);
resize_set (set);
return weak_set_add_x (set, hash >> 1, pred, closure, obj);
}