aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-01 14:24:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-01 14:24:34 +0000
commit541dac0b9b664728ad07e4ea7ea7b7f5a3475147 (patch)
tree7f906e8bcddbc79a157d5a4fb96c105e072dccb5
parent21a58208f1342b9373aaab14e70c675461e1e764 (diff)
downloadruby-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--ChangeLog5
-rw-r--r--gc.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dfd984c81..3115e5ae80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/gc.c b/gc.c
index 6bc362b994..1f04ce507c 100644
--- a/gc.c
+++ b/gc.c
@@ -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;
}