summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-05 01:47:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-05 01:47:12 +0000
commitc06f12031ee1f6a7f51448f0688a20d571aed880 (patch)
tree871ffb1e4d06c539e17f594d25ebe20d9a2f040b /gc.c
parent3e36402e7fd71a7bac2f54fa8617cd7e30aecd9c (diff)
gc.c: flush all deferred finalizers
* gc.c (finalize_deferred): flush all deferred finalizers while other finalizers can get ready to run newly by lazy sweep. [ruby-core:58833] [Bug #9205] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index a10c46f878..61812d051e 100644
--- a/gc.c
+++ b/gc.c
@@ -2055,10 +2055,9 @@ finalize_list(rb_objspace_t *objspace, RVALUE *p)
static void
finalize_deferred(rb_objspace_t *objspace)
{
- RVALUE *p = heap_pages_deferred_final;
- heap_pages_deferred_final = 0;
+ RVALUE *p;
- if (p) {
+ while ((p = ATOMIC_PTR_EXCHANGE(heap_pages_deferred_final, 0)) != 0) {
finalize_list(objspace, p);
}
}