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:
parent
869159006a
commit
a103d128cd
1 changed files with 6 additions and 4 deletions
10
gc.c
10
gc.c
|
@ -776,15 +776,17 @@ rb_gc_mark_children(ptr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_ARRAY:
|
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;
|
long i, len = obj->as.array.len;
|
||||||
VALUE *ptr = obj->as.array.ptr;
|
VALUE *ptr = obj->as.array.ptr;
|
||||||
|
|
||||||
for (i=0; i < len; i++)
|
for (i=0; i < len; i++) {
|
||||||
rb_gc_mark(*ptr++);
|
rb_gc_mark(*ptr++);
|
||||||
}
|
}
|
||||||
if (FL_TEST(obj, ELTS_SHARED))
|
}
|
||||||
rb_gc_mark(obj->as.array.aux.shared);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_HASH:
|
case T_HASH:
|
||||||
|
|
Loading…
Reference in a new issue