summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--gc.c10
-rw-r--r--test/ruby/test_gc.rb4
-rw-r--r--version.h2
4 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b7742dfd8..67b3ccfc20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov 16 19:58:02 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (gc_sweep): makes new room if object space is full of
+ finalized objects and has no free objects. [ruby-dev:39201]
+
Mon Nov 16 19:45:27 2009 Tanaka Akira <akr@fsij.org>
* util.c: suppress strict-aliasing warning with gcc-4.4.0 -O2 to fix
diff --git a/gc.c b/gc.c
index 52b1c23e6b..aec9b5e756 100644
--- a/gc.c
+++ b/gc.c
@@ -1223,7 +1223,15 @@ gc_sweep()
/* 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();
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index d0b4e3df77..ed854bde65 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -26,5 +26,9 @@ class TestGc < Test::Unit::TestCase
}
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
diff --git a/version.h b/version.h
index 7363a0cbbc..51939d7e46 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-11-16"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20091116
-#define RUBY_PATCHLEVEL 204
+#define RUBY_PATCHLEVEL 205
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8