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

ruby-changes:37943

From: ko1 <ko1@a...>
Date: Thu, 19 Mar 2015 16:14:22 +0900 (JST)
Subject: [ruby-changes:37943] ko1:r50024 (trunk): * gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.

ko1	2015-03-19 16:14:12 +0900 (Thu, 19 Mar 2015)

  New Revision: 50024

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

  Log:
    * gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
      * skip on incremental marking because not sure what happen :p
      * rb_gc_writebarrier_remember() is enough to mark children.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50023)
+++ ChangeLog	(revision 50024)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 19 16:12:01 2015  Koichi Sasada  <ko1@a...>
+
+	* gc.c (newobj_of): fix RGENGC_OLD_NEWOBJ_CHECK logics.
+	  * skip on incremental marking because not sure what happen :p
+	  * rb_gc_writebarrier_remember() is enough to mark children.
+
 Thu Mar 19 16:08:42 2015  Koichi Sasada  <ko1@a...>
 
 	* gc.c (rb_copy_wb_protected_attribute): need demote for old objects.
Index: gc.c
===================================================================
--- gc.c	(revision 50023)
+++ gc.c	(revision 50024)
@@ -1748,7 +1748,8 @@ newobj_of(VALUE klass, VALUE flags, VALU https://github.com/ruby/ruby/blob/trunk/gc.c#L1748
     {
 	static int newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
 
-	if (flags & FL_WB_PROTECTED &&   /* do not promote WB unprotected objects */
+	if (!is_incremental_marking(objspace) &&
+	    flags & FL_WB_PROTECTED &&   /* do not promote WB unprotected objects */
 	    ! RB_TYPE_P(obj, T_ARRAY)) { /* array.c assumes that allocated objects are new */
 	    if (--newobj_cnt == 0) {
 		newobj_cnt = RGENGC_OLD_NEWOBJ_CHECK;
@@ -1756,10 +1757,7 @@ newobj_of(VALUE klass, VALUE flags, VALU https://github.com/ruby/ruby/blob/trunk/gc.c#L1757
 		gc_mark_set(objspace, obj);
 		RVALUE_AGE_SET_OLD(objspace, obj);
 
-		if (is_pointer_to_heap(objspace, (void *)klass)) RB_OBJ_WRITTEN(obj, Qundef, klass);
-		if (is_pointer_to_heap(objspace, (void *)v1))    RB_OBJ_WRITTEN(obj, Qundef, v1);
-		if (is_pointer_to_heap(objspace, (void *)v2))    RB_OBJ_WRITTEN(obj, Qundef, v2);
-		if (is_pointer_to_heap(objspace, (void *)v3))    RB_OBJ_WRITTEN(obj, Qundef, v3);
+		rb_gc_writebarrier_remember(obj);
 	    }
 	}
     }

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

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