diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-05 01:47:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-05 01:47:12 +0000 |
commit | c06f12031ee1f6a7f51448f0688a20d571aed880 (patch) | |
tree | 871ffb1e4d06c539e17f594d25ebe20d9a2f040b /gc.c | |
parent | 3e36402e7fd71a7bac2f54fa8617cd7e30aecd9c (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); } } |