diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-04 12:10:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-10-04 12:10:09 +0000 |
commit | 92a05ea2cf375e415ddd420243d0e38801708f8a (patch) | |
tree | 4f7741ae3ff738482c615ecd8319963ce7e03fb9 /class.c | |
parent | 0688c81a89e506f426df8b58cb57a706477bf95c (diff) | |
download | ruby-92a05ea2cf375e415ddd420243d0e38801708f8a.tar.gz |
* class.c (class_alloc): allocate extra memory after containing
object setup to get rid of rare-but-potential memory leak.
* gc.c (gc_mark_children): skip marking extended members if ptr is
NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; |