Skip to content

Commit

Permalink
Merge pull request ocaml-multicore/ocaml-multicore#511 from sadiqj/fi…
Browse files Browse the repository at this point in the history
…x_unique_token_root

Allocate unique root token on the major heap instead of the minor
  • Loading branch information
Sudha247 authored Mar 26, 2021
2 parents dad476e + 0913c23 commit a3ea5f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ static void create_domain(uintnat initial_minor_heap_wsize) {
goto create_dls_root_failure;
}

domain_state->unique_token_root = caml_alloc_1(Abstract_tag, Val_unit);
domain_state->unique_token_root = caml_alloc_shr_noexc(Abstract_tag, Val_unit);
if(domain_state->unique_token_root == (value)NULL) {
goto create_unique_token_failure;
}

caml_register_generational_global_root(&domain_state->unique_token_root);

domain_state->stack_cache = caml_alloc_stack_cache();
Expand Down Expand Up @@ -318,6 +322,7 @@ static void create_domain(uintnat initial_minor_heap_wsize) {
create_stack_cache_failure:
caml_remove_generational_global_root(&domain_state->unique_token_root);
caml_delete_root(domain_state->dls_root);
create_unique_token_failure:
create_dls_root_failure:
reallocate_minor_heap_failure:
caml_teardown_major_gc();
Expand Down

0 comments on commit a3ea5f2

Please sign in to comment.