Skip to content

Commit 64c1427

Browse files
peterzhu2118matzbot
authored andcommitted
[ruby/mmtk] Fix assertion in rb_gc_impl_ractor_cache_free for RUBY_FREE_AT_EXIT
ruby/mmtk@e2a89d5a22
1 parent b7e9e66 commit 64c1427

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gc/mmtk/mmtk.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,13 @@ rb_gc_impl_ractor_cache_free(void *objspace_ptr, void *cache_ptr)
603603

604604
ccan_list_del(&cache->list_node);
605605

606-
MMTK_ASSERT(objspace->live_ractor_cache_count > 1);
606+
if (ruby_free_at_exit_p()) {
607+
MMTK_ASSERT(objspace->live_ractor_cache_count > 0);
608+
}
609+
else {
610+
MMTK_ASSERT(objspace->live_ractor_cache_count > 1);
611+
}
612+
607613
objspace->live_ractor_cache_count--;
608614

609615
mmtk_destroy_mutator(cache->mutator);

0 commit comments

Comments
 (0)