зеркало из https://github.com/github/ruby.git
* 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:
Родитель
a016b30844
Коммит
7d072e2ba4
|
@ -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
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++;
|
||||
|
|
Загрузка…
Ссылка в новой задаче