diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-01 14:24:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-01 14:24:34 +0000 |
commit | 541dac0b9b664728ad07e4ea7ea7b7f5a3475147 (patch) | |
tree | 7f906e8bcddbc79a157d5a4fb96c105e072dccb5 | |
parent | 21a58208f1342b9373aaab14e70c675461e1e764 (diff) | |
download | ruby-541dac0b9b664728ad07e4ea7ea7b7f5a3475147.tar.gz |
gc.c: mark live objects only
* gc.c (wmap_mark_map): mark live objects only, but delete zombies.
[ruby-dev:47787] [Bug #9069]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gc.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Nov 1 23:24:31 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c (wmap_mark_map): mark live objects only, but delete zombies. + [ruby-dev:47787] [Bug #9069] + Fri Nov 1 22:45:54 2013 Masaya Tarui <tarui@ruby-lang.org> * gc.c (struct heap_page, gc_page_sweep, gc_sweep): Refactoring for @@ -5302,7 +5302,10 @@ struct weakmap { static int wmap_mark_map(st_data_t key, st_data_t val, st_data_t arg) { - gc_mark_ptr((rb_objspace_t *)arg, (VALUE)val); + rb_objspace_t *objspace = (rb_objspace_t *)arg; + VALUE obj = (VALUE)val; + if (!is_live_object(objspace, obj)) return ST_DELETE; + gc_mark_ptr(objspace, obj); return ST_CONTINUE; } |