ruby-changes:54988
From: nobu <ko1@a...>
Date: Sat, 9 Mar 2019 09:00:31 +0900 (JST)
Subject: [ruby-changes:54988] nobu:r67195 (trunk): Early return in gc_mark_children
nobu 2019-03-09 09:00:26 +0900 (Sat, 09 Mar 2019) New Revision: 67195 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67195 Log: 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?\195?\169 <lourens@b...> Modified files: trunk/gc.c Index: gc.c =================================================================== --- gc.c (revision 67194) +++ gc.c (revision 67195) @@ -4694,6 +4694,13 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L4694 } 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 https://github.com/ruby/ruby/blob/trunk/gc.c#L4812 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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/