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

ruby-changes:5285

From: shyouhei <ko1@a...>
Date: Tue, 3 Jun 2008 15:45:57 +0900 (JST)
Subject: [ruby-changes:5285] Ruby:r16783 (ruby_1_8_6): merge revision(s) 13497:

shyouhei	2008-06-03 15:45:44 +0900 (Tue, 03 Jun 2008)

  New Revision: 16783

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/gc.c
    branches/ruby_1_8_6/version.h

  Log:
    merge revision(s) 13497:
    * gc.c (os_obj_of, os_each_obj): hide objects to be finalized.
      [ruby-dev:31810]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/ChangeLog?r1=16783&r2=16782&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/version.h?r1=16783&r2=16782&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_6/gc.c?r1=16783&r2=16782&diff_format=u

Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 16782)
+++ ruby_1_8_6/ChangeLog	(revision 16783)
@@ -1,3 +1,8 @@
+Tue Jun  3 15:45:00 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (os_obj_of, os_each_obj): hide objects to be finalized.
+	  [ruby-dev:31810]
+
 Tue Jun  3 15:22:47 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* process.c (struct rb_exec_arg): proc should be a VALUE.
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 16782)
+++ ruby_1_8_6/version.h	(revision 16783)
@@ -2,7 +2,7 @@
 #define RUBY_RELEASE_DATE "2008-06-03"
 #define RUBY_VERSION_CODE 186
 #define RUBY_RELEASE_CODE 20080603
-#define RUBY_PATCHLEVEL 121
+#define RUBY_PATCHLEVEL 122
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
Index: ruby_1_8_6/gc.c
===================================================================
--- ruby_1_8_6/gc.c	(revision 16782)
+++ ruby_1_8_6/gc.c	(revision 16783)
@@ -1599,38 +1599,6 @@
 }
 
 static VALUE
-os_live_obj()
-{
-    int i;
-    int n = 0;
-
-    for (i = 0; i < heaps_used; i++) {
-	RVALUE *p, *pend;
-
-	p = heaps[i].slot; pend = p + heaps[i].limit;
-	for (;p < pend; p++) {
-	    if (p->as.basic.flags) {
-		switch (TYPE(p)) {
-		  case T_ICLASS:
-		  case T_VARMAP:
-		  case T_SCOPE:
-		  case T_NODE:
-		    continue;
-		  case T_CLASS:
-		    if (FL_TEST(p, FL_SINGLETON)) continue;
-		  default:
-		    if (!p->as.basic.klass) continue;
-		    rb_yield((VALUE)p);
-		    n++;
-		}
-	    }
-	}
-    }
-
-    return INT2FIX(n);
-}
-
-static VALUE
 os_obj_of(of)
     VALUE of;
 {
@@ -1644,6 +1612,7 @@
 	for (;p < pend; p++) {
 	    if (p->as.basic.flags) {
 		switch (TYPE(p)) {
+		  case T_NONE:
 		  case T_ICLASS:
 		  case T_VARMAP:
 		  case T_SCOPE:
@@ -1653,7 +1622,7 @@
 		    if (FL_TEST(p, FL_SINGLETON)) continue;
 		  default:
 		    if (!p->as.basic.klass) continue;
-		    if (rb_obj_is_kind_of((VALUE)p, of)) {
+		    if (!of || rb_obj_is_kind_of((VALUE)p, of)) {
 			rb_yield((VALUE)p);
 			n++;
 		    }
@@ -1707,11 +1676,9 @@
 
     rb_secure(4);
     if (rb_scan_args(argc, argv, "01", &of) == 0) {
-	return os_live_obj();
+	of = 0;
     }
-    else {
-	return os_obj_of(of);
-    }
+    return os_obj_of(of);
 }
 
 static VALUE finalizers;

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

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