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

ruby-changes:33557

From: normal <ko1@a...>
Date: Sun, 20 Apr 2014 06:24:50 +0900 (JST)
Subject: [ruby-changes:33557] normal:r45638 (trunk): gc.c: drop special case for big hash/array

normal	2014-04-20 06:24:45 +0900 (Sun, 20 Apr 2014)

  New Revision: 45638

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

  Log:
    gc.c: drop special case for big hash/array
    
    * gc.c (rb_gc_writebarrier): drop special case for big hash/array
      [Bug #9518]

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45637)
+++ ChangeLog	(revision 45638)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Apr 20 06:01:18 2014  Eric Wong  <e@8...>
+
+	* gc.c (rb_gc_writebarrier): drop special case for big hash/array
+	  [Bug #9518]
+
 Sat Apr 19 15:38:29 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (primary): flush cmdarg flags inside left-paren in a
Index: gc.c
===================================================================
--- gc.c	(revision 45637)
+++ gc.c	(revision 45638)
@@ -4789,20 +4789,9 @@ rb_gc_writebarrier(VALUE a, VALUE b) https://github.com/ruby/ruby/blob/trunk/gc.c#L4789
 	rb_objspace_t *objspace = &rb_objspace;
 
 	if (!rgengc_remembered(objspace, a)) {
-	    int type = BUILTIN_TYPE(a);
-	    /* TODO: 2 << 16 is just a magic number. */
-	    if ((type == T_ARRAY && RARRAY_LEN(a) >= 2 << 16) ||
-		(type == T_HASH  && RHASH_SIZE(a) >= 2 << 16)) {
-		if (!rgengc_remembered(objspace, b)) {
-		    rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n", (void *)a, obj_type_name(a), (void *)b, obj_type_name(b));
-		    rgengc_remember(objspace, b);
-		}
-	    }
-	    else {
-		rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n",
-			      (void *)a, obj_type_name(a), (void *)b, obj_type_name(b));
-		rgengc_remember(objspace, a);
-	    }
+	    rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n",
+			  (void *)a, obj_type_name(a), (void *)b, obj_type_name(b));
+	    rgengc_remember(objspace, a);
 	}
     }
 }

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

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