[前][次][番号順一覧][スレッド一覧]

ruby-changes:31430

From: nobu <ko1@a...>
Date: Fri, 1 Nov 2013 23:24:40 +0900 (JST)
Subject: [ruby-changes:31430] nobu:r43509 (trunk): gc.c: mark live objects only

nobu	2013-11-01 23:24:34 +0900 (Fri, 01 Nov 2013)

  New Revision: 43509

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43509

  Log:
    gc.c: mark live objects only
    
    * gc.c (wmap_mark_map): mark live objects only, but delete zombies.
      [ruby-dev:47787] [Bug #9069]

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43508)
+++ ChangeLog	(revision 43509)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Nov  1 23:24:31 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* gc.c (struct heap_page, gc_page_sweep, gc_sweep): Refactoring for
Index: gc.c
===================================================================
--- gc.c	(revision 43508)
+++ gc.c	(revision 43509)
@@ -5302,7 +5302,10 @@ struct weakmap { https://github.com/ruby/ruby/blob/trunk/gc.c#L5302
 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;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]