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

* variable.c (rb_copy_generic_ivar): remove old generic instance

variable table if it existes.

	* class.c (rb_make_metaclass): metaclass of a metaclass is a
	  metaclass itself.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-09-03 05:20:14 +00:00
parent 20254d4e13
commit 6f484e4930
22 changed files with 276 additions and 238 deletions

View file

@ -148,7 +148,7 @@ static VALUE strio_closed _((VALUE));
static VALUE strio_closed_read _((VALUE));
static VALUE strio_closed_write _((VALUE));
static VALUE strio_eof _((VALUE));
static VALUE strio_clone _((VALUE));
static VALUE strio_become _((VALUE, VALUE));
static VALUE strio_get_lineno _((VALUE));
static VALUE strio_set_lineno _((VALUE, VALUE));
static VALUE strio_get_pos _((VALUE));
@ -405,14 +405,17 @@ strio_eof(self)
}
static VALUE
strio_clone(self)
VALUE self;
strio_become(copy, orig)
VALUE copy, orig;
{
struct StringIO *ptr = StringIO(self);
VALUE clone = rb_call_super(0, 0);
DATA_PTR(clone) = ptr;
struct StringIO *ptr = StringIO(orig);
if (DATA_PTR(copy)) {
strio_free(DATA_PTR(ptr));
}
DATA_PTR(copy) = ptr;
++ptr->count;
return self;
return copy;
}
static VALUE
@ -883,8 +886,7 @@ Init_stringio()
rb_define_singleton_method(StringIO, "open", strio_s_open, -1);
rb_define_method(StringIO, "initialize", strio_initialize, -1);
rb_enable_super(StringIO, "initialize");
rb_define_method(StringIO, "clone", strio_clone, 0);
rb_enable_super(StringIO, "clone");
rb_define_method(StringIO, "become", strio_become, 1);
rb_define_method(StringIO, "reopen", strio_reopen, -1);
rb_define_method(StringIO, "string", strio_get_string, 0);