summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-06 12:25:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-06 12:25:47 +0000
commit7d072e2ba4c318fdd97bfcd093e160efdb8dc03d (patch)
tree2a99578653c3707471a58fe6df20db20bd315bb5
parenta016b30844683df63fcb85387e6d01b49732351c (diff)
* gc.c (chain_finalized_object): deletes finalizers to be invoked from
finalizer_table. * gc.c (rb_gc_call_finalizer_at_exit): warns when could not invoke finalizers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--gc.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bf76395ca5..3297fcc340a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Aug 6 21:25:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * gc.c (chain_finalized_object): deletes finalizers to be invoked from
+ finalizer_table.
+
+ * gc.c (rb_gc_call_finalizer_at_exit): warns when could not invoke
+ finalizers.
+
Wed Aug 6 20:56:43 2008 Tanaka Akira <akr@fsij.org>
* enc/depend: transcode table generation depends on
diff --git a/gc.c b/gc.c
index 6c9666585d3..120b396d5e8 100644
--- a/gc.c
+++ b/gc.c
@@ -2092,6 +2092,7 @@ chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
}
p->as.free.next = *final_list;
*final_list = p;
+ return ST_DELETE;
}
return ST_CONTINUE;
}
@@ -2113,6 +2114,12 @@ rb_gc_call_finalizer_at_exit(void)
st_foreach(finalizer_table, chain_finalized_object,
(st_data_t)&deferred_final_list);
} while (deferred_final_list);
+ if (finalizer_table->num_entries) {
+ rb_warning("%d finalizer%s left not-invoked due to self-reference",
+ finalizer_table->num_entries,
+ finalizer_table->num_entries > 1 ? "s" : "");
+ }
+ st_free_table(finalizer_table);
}
/* finalizers are part of garbage collection */
during_gc++;