diff options
author | eileencodes <eileencodes@gmail.com> | 2021-06-22 13:43:18 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-06-23 10:03:09 -0700 |
commit | 8209b735807d449c0a870562ee240585127ee100 (patch) | |
tree | 7a113ac65fb1a469d0a4ea7b99f920f1fd1966d7 /bootstraptest/test_ractor.rb | |
parent | 2fb435b3ab19bab644083c6eaf7ff06ce5b01841 (diff) |
Evacuate transient heap when enabling ractors
If the GC has been disabled we need to re-enable it so we can evacuate
the transient heap.
Fixes https://bugs.ruby-lang.org/issues/17985
[Bug #17985] [ruby-core:104260]
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4596
Diffstat (limited to 'bootstraptest/test_ractor.rb')
-rw-r--r-- | bootstraptest/test_ractor.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bootstraptest/test_ractor.rb b/bootstraptest/test_ractor.rb index 7e77dfcec1..80591f6459 100644 --- a/bootstraptest/test_ractor.rb +++ b/bootstraptest/test_ractor.rb @@ -1405,4 +1405,17 @@ assert_equal "ok", %q{ end } +assert_equal "ok", %q{ + GC.disable + Ractor.new {} + raise "not ok" unless GC.disable + + foo = [] + 10.times { foo << 1 } + + GC.start + + 'ok' +} + end # if !ENV['GITHUB_WORKFLOW'] |