fix GC bug
GC during allocation of a pair, weak box, ephemeron, or
weak array went wrong if the GC-notification callback
allocated any of those kinds of things.
(Bug found by running tests in GC-stress mode.)
(cherry picked from commit 49fbca5b18
)
This commit is contained in:
parent
ce410d7405
commit
161986fc56
|
@ -4788,10 +4788,25 @@ static void garbage_collect(NewGC *gc, int force_full, int switching_master, Log
|
|||
#ifdef MZ_USE_PLACES
|
||||
is_master = (gc == MASTERGC);
|
||||
#endif
|
||||
gc->dumping_avoid_collection++;
|
||||
|
||||
/* Inform might allocate, which might need park: */
|
||||
gc->park_save[0] = gc->park[0];
|
||||
gc->park_save[1] = gc->park[1];
|
||||
gc->park[0] = NULL;
|
||||
gc->park[1] = NULL;
|
||||
|
||||
gc->GC_collect_inform_callback(is_master, gc->gc_full,
|
||||
old_mem_use + old_gen0, gc->memory_in_use,
|
||||
old_mem_allocated, mmu_memory_allocated(gc->mmu),
|
||||
gc->child_gc_total);
|
||||
|
||||
gc->park[0] = gc->park_save[0];
|
||||
gc->park[1] = gc->park_save[1];
|
||||
gc->park_save[0] = NULL;
|
||||
gc->park_save[1] = NULL;
|
||||
|
||||
--gc->dumping_avoid_collection;
|
||||
}
|
||||
#ifdef MZ_USE_PLACES
|
||||
if (lmi) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user