summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-22 06:24:54 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-22 06:24:54 +0000
commitf5b15f0e3f6d3f3b3467059802e24c8de0d9d361 (patch)
tree714c98acc6dabd7d4b0959744ae4eac36c325c82 /gc.c
parent3636f8c0f56ddf15e26e28e7a38e748588fad976 (diff)
* vm_trace.c: exterminate Zombies.
There is a bug that T_ZOMBIE objects are not collected. Because there is a pass to miss finalizer postponed job with multi-threading. This patch solve this issue. * vm_trace.c (rb_postponed_job_register_one): set RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th) if another same job is registered. There is a possibility to remain a postponed job without interrupt flag. * vm_trace.c (rb_postponed_job_register_one): check interrupt carefully. * vm_trace.c (rb_postponed_job_register_one): use additional space to avoid buffer full. * gc.c (gc_finalize_deferred_register): check failure. * thread.c (rb_threadptr_execute_interrupts): check `postponed_job_interrupt' immediately. There is a possibility to miss this flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 634ba0d41c..b25e532014 100644
--- a/gc.c
+++ b/gc.c
@@ -1821,7 +1821,9 @@ rb_gc_finalize_deferred(void)
static void
gc_finalize_deferred_register()
{
- rb_postponed_job_register_one(0, gc_finalize_deferred, 0);
+ if (rb_postponed_job_register_one(0, gc_finalize_deferred, 0) == 0) {
+ rb_bug("gc_finalize_deferred_register: can't register finalizer.");
+ }
}
struct force_finalize_list {