mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Early return in gc_mark_children
for types Float, Bignum and Symbol as they do not have references and singleton classes. [Fix GH-2091] From: Lourens Naudé <lourens@bearmetal.eu> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
caa2a5bb0e
commit
d577019746
1 changed files with 7 additions and 5 deletions
12
gc.c
12
gc.c
|
@ -4694,6 +4694,13 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
|
|||
}
|
||||
|
||||
switch (BUILTIN_TYPE(obj)) {
|
||||
case T_FLOAT:
|
||||
case T_BIGNUM:
|
||||
case T_SYMBOL:
|
||||
/* Not immediates, but does not have references and singleton
|
||||
* class */
|
||||
return;
|
||||
|
||||
case T_NIL:
|
||||
case T_FIXNUM:
|
||||
rb_bug("rb_gc_mark() called for broken object");
|
||||
|
@ -4805,11 +4812,6 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
|
|||
gc_mark(objspace, any->as.regexp.src);
|
||||
break;
|
||||
|
||||
case T_FLOAT:
|
||||
case T_BIGNUM:
|
||||
case T_SYMBOL:
|
||||
break;
|
||||
|
||||
case T_MATCH:
|
||||
gc_mark(objspace, any->as.match.regexp);
|
||||
if (any->as.match.str) {
|
||||
|
|
Loading…
Reference in a new issue