summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-04 09:23:51 +0000
committermichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-04 09:23:51 +0000
commita103d128cdb67dd87b5501e71e7a95876afd17ca (patch)
tree4051fc85f5e99ca537338b8f111873aa1241c16c /gc.c
parent869159006a16e3d5bfded997ab273de8d30f752b (diff)
Opt for Array in rb_gc_mark_children() (ruby-core:410)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gc.c b/gc.c
index e5ecea7..03c47fc 100644
--- a/gc.c
+++ b/gc.c
@@ -776,15 +776,17 @@ rb_gc_mark_children(ptr)
break;
case T_ARRAY:
- {
+ if (FL_TEST(obj, ELTS_SHARED)) {
+ rb_gc_mark(obj->as.array.aux.shared);
+ }
+ else {
long i, len = obj->as.array.len;
VALUE *ptr = obj->as.array.ptr;
- for (i=0; i < len; i++)
+ for (i=0; i < len; i++) {
rb_gc_mark(*ptr++);
+ }
}
- if (FL_TEST(obj, ELTS_SHARED))
- rb_gc_mark(obj->as.array.aux.shared);
break;
case T_HASH: