[前][次][番号順一覧][スレッド一覧]

ruby-changes:12971

From: nobu <ko1@a...>
Date: Sun, 30 Aug 2009 15:12:56 +0900 (JST)
Subject: [ruby-changes:12971] Ruby:r24713 (ruby_1_8): * gc.c (gc_sweep): makes new room if object space is full of

nobu	2009-08-30 15:12:37 +0900 (Sun, 30 Aug 2009)

  New Revision: 24713

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24713

  Log:
    * gc.c (gc_sweep): makes new room if object space is full of
      finalized objects and has no free objects.  [ruby-dev:39201]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/gc.c
    branches/ruby_1_8/test/ruby/test_gc.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 24712)
+++ ruby_1_8/ChangeLog	(revision 24713)
@@ -1,3 +1,8 @@
+Sun Aug 30 15:12:22 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (gc_sweep): makes new room if object space is full of
+	  finalized objects and has no free objects.  [ruby-dev:39201]
+
 Sat Aug 29 07:03:26 2009  Masaki Suketa  <masaki.suketa@n...>
 
 	* ext/win32ole/win32ole.c (fole_s_show_help): fixed the comment
Index: ruby_1_8/test/ruby/test_gc.rb
===================================================================
--- ruby_1_8/test/ruby/test_gc.rb	(revision 24712)
+++ ruby_1_8/test/ruby/test_gc.rb	(revision 24713)
@@ -26,5 +26,9 @@
     }
     GC.start
     assert true   # reach here or dumps core
+    100000.times {
+      Time.now
+    }
+    assert true, '[ruby-dev:39201]'   # reach here or dumps core
   end
 end
Index: ruby_1_8/gc.c
===================================================================
--- ruby_1_8/gc.c	(revision 24712)
+++ ruby_1_8/gc.c	(revision 24713)
@@ -1246,7 +1246,15 @@
     /* clear finalization list */
     if (final_list) {
 	deferred_final_list = final_list;
-	rb_thread_pending = 1;
+	if (!freelist && !rb_thread_critical) {
+	    rb_gc_finalize_deferred();
+	}
+	else {
+	    rb_thread_pending = 1;
+	}
+	if (!freelist) {
+	    add_heap();
+	}
 	return;
     }
     free_unused_heaps();

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]