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 /gc.c | |
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
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |