Skip to content

Commit 7e20367

Browse files
NickBarnesstedolan
andauthored
Fix ephemeron-adoption problem in mark-delay (#3332)
Fix ephemeron-adoption problem found when upstreaming mark-delay to ocaml/ocaml#13580. Co-authored-by: Stephen Dolan <[email protected]>
1 parent eee3040 commit 7e20367

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
@@ -1410,13 +1410,14 @@ void caml_mark_roots_stw (int participant_count, caml_domain_state** barrier_par
14101410
Caml_global_barrier_if_final(participant_count) {
14111411
caml_gc_phase = Phase_sweep_and_mark_main;
14121412
atomic_store_relaxed(&global_roots_scanned, WORK_UNSTARTED);
1413+
/* Adopt orphaned work from domains that were spawned and
1414+
terminated in the previous cycle. Do this in the barrier,
1415+
before any domain can terminate on this cycle. */
1416+
adopt_orphaned_work (caml_global_heap_state.UNMARKED);
14131417
}
14141418

14151419
caml_domain_state* domain = Caml_state;
14161420

1417-
/* Adopt orphaned work from domains that were spawned and terminated in the
1418-
previous cycle. */
1419-
adopt_orphaned_work (caml_global_heap_state.UNMARKED);
14201421

14211422
begin_ephe_marking();
14221423

0 commit comments

Comments
 (0)