Skip to content

Commit 7c04f6f

Browse files
NickBarnesstedolan
andcommitted
Fix ephemeron-adoption problem found when upstreaming mark-delay to ocaml/ocaml#13580.
Co-authored-by: Stephen Dolan <[email protected]>
1 parent 1109768 commit 7c04f6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

runtime/major_gc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,13 +1431,14 @@ void caml_mark_roots_stw (int participant_count, caml_domain_state** barrier_par
14311431
Caml_global_barrier_if_final(participant_count) {
14321432
caml_gc_phase = Phase_sweep_and_mark_main;
14331433
atomic_store_relaxed(&global_roots_scanned, WORK_UNSTARTED);
1434+
/* Adopt orphaned work from domains that were spawned and
1435+
terminated in the previous cycle. Do this in the barrier,
1436+
before any domain can terminate on this cycle. */
1437+
adopt_orphaned_work (caml_global_heap_state.UNMARKED);
14341438
}
14351439

14361440
caml_domain_state* domain = Caml_state;
14371441

1438-
/* Adopt orphaned work from domains that were spawned and terminated in the
1439-
previous cycle. */
1440-
adopt_orphaned_work (caml_global_heap_state.UNMARKED);
14411442

14421443
begin_ephe_marking();
14431444

0 commit comments

Comments
 (0)