* 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
This commit is contained in:
nobu 2008-08-06 12:25:47 +00:00
Родитель a016b30844
Коммит 7d072e2ba4
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -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

7
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++;