1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
michal 2002-09-04 09:23:51 +00:00
parent 869159006a
commit a103d128cd

10
gc.c
View file

@ -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: