summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 09:44:08 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 09:44:08 +0000
commit0688c81a89e506f426df8b58cb57a706477bf95c (patch)
treef9471b20d6715da3cef75cab520d4b3d8249b85e
parent4eb497d90b0d439458e7f34046bbe41d38e4c06a (diff)
Revert r33397 because it cause segv.
"* class.c (class_alloc): allocate extra memory after containing" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--class.c3
2 files changed, 2 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e9a34e0d1..b8757622ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,11 +3,6 @@ Tue Oct 4 16:17:50 2011 NARUSE, Yui <naruse@ruby-lang.org>
* lib/time.rb (Time.strptime): use Time.at if d[:seconds] is set.
Reported by Christopher Eberz. [ruby-core:39903] Bug #5399
-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.
diff --git a/class.c b/class.c
index b595473333..e6c1f8fd11 100644
--- a/class.c
+++ b/class.c
@@ -49,9 +49,10 @@ 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 = ALLOC(rb_classext_t);
+ obj->ptr = ext;
RCLASS_IV_TBL(obj) = 0;
RCLASS_CONST_TBL(obj) = 0;
RCLASS_M_TBL(obj) = 0;