Skip to content

Commit

Permalink
ruby_single_main_ractor should be clear before warn
Browse files Browse the repository at this point in the history
rb_warn can produce T_HASA object and it should not use
transient heap.
  • Loading branch information
ko1 committed Dec 23, 2020
1 parent 02233ed commit 7e44ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ractor.c
Expand Up @@ -1386,13 +1386,13 @@ cancel_single_ractor_mode(void)
rb_gc_start();
rb_transient_heap_evacuate();

ruby_single_main_ractor = NULL;

if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL)) {
rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL,
"Ractor is experimental, and the behavior may change in future versions of Ruby! "
"Also there are many implementation issues.");
}

ruby_single_main_ractor = NULL;
}

static void
Expand Down

0 comments on commit 7e44ade

Please sign in to comment.