From 136ae55892ae120bb94e4ff2d025c745fdaa1091 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Thu, 23 May 2019 11:21:16 +0900 Subject: Do not kick finalizers on rb_gc(). rb_gc() kicks gc_finalize_deferred(), which invokes finalizers. This means that any Ruby program can be run this point and it may be thread switching points and so on. However, it is difficult to think it invokes any Ruby programs. For example, `GC.compact` use `rb_gc()` to implement it, howver, any Ruby program must not be run on this timing. For this reason (it is difficult to image it run any Ruby program), I removed `gc_finalize_deferred()` line in rb_gc(). This patch solves GC.compact issue. [Bug #15809] and re-enable GC.compact test. --- test/ruby/test_gc_compact.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'test/ruby/test_gc_compact.rb') diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index d2b2c1bb47..5669fd3d6a 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -2,8 +2,6 @@ require 'test/unit' require 'fiddle' -return - class TestGCCompact < Test::Unit::TestCase def memory_location(obj) (Fiddle.dlwrap(obj) >> 1) -- cgit v1.2.3