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

* class.c (class_alloc): allocate extra memory after containing

object setup to get rid of rare-but-potential memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-10-04 06:04:46 +00:00
parent e6c2da74e6
commit bf8168cf33
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Oct 4 15:04:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (class_alloc): allocate extra memory after containing
object setup to get rid of rare-but-potential memory leak.
Tue Oct 4 11:44:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
* gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.

View file

@ -49,10 +49,9 @@ static ID id_attached;
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
rb_classext_t *ext = ALLOC(rb_classext_t);
NEWOBJ(obj, struct RClass);
OBJSETUP(obj, klass, flags);
obj->ptr = ext;
obj->ptr = ALLOC(rb_classext_t);
RCLASS_IV_TBL(obj) = 0;
RCLASS_CONST_TBL(obj) = 0;
RCLASS_M_TBL(obj) = 0;