summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 06:45:44 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 06:45:44 +0000
commit2062a9149e8a4232b08520200b18a393782e87dd (patch)
treeeb7acc081cab6240d4349899f6c365c7d4b8953f
parent1f81e3a8d7820b8a30f6f125f9947f9c8a250743 (diff)
merge revision(s) 13497:
* gc.c (os_obj_of, os_each_obj): hide objects to be finalized. [ruby-dev:31810] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@16783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--gc.c41
-rw-r--r--version.h2
3 files changed, 10 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 66f7872f5a..6aadd235d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jun 3 15:45:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* process.c (struct rb_exec_arg): proc should be a VALUE.
diff --git a/gc.c b/gc.c
index 9ac3bfbf6f..052df8f362 100644
--- a/gc.c
+++ b/gc.c
@@ -1599,38 +1599,6 @@ Init_heap()
}
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 @@ os_obj_of(of)
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 @@ os_obj_of(of)
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 @@ os_each_obj(argc, argv)
rb_secure(4);
if (rb_scan_args(argc, argv, "01", &of) == 0) {
- return os_live_obj();
- }
- else {
- return os_obj_of(of);
+ of = 0;
}
+ return os_obj_of(of);
}
static VALUE finalizers;
diff --git a/version.h b/version.h
index 47d8acba2e..a282d91829 100644
--- a/version.h
+++ b/version.h
@@ -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