1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-01-05 04:41:21 +00:00
parent a1d1b15167
commit de71615260
69 changed files with 1873 additions and 1103 deletions

View file

@ -407,14 +407,14 @@ static VALUE
rb_struct_clone(s)
VALUE s;
{
NEWOBJ(st, struct RStruct);
CLONESETUP(st, s);
st->len = 0; /* avoid GC crashing */
st->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
st->len = RSTRUCT(s)->len;
MEMCPY(st->ptr, RSTRUCT(s)->ptr, VALUE, st->len);
NEWOBJ(clone, struct RStruct);
CLONESETUP(clone, s);
clone->len = 0; /* avoid GC crashing */
clone->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
clone->len = RSTRUCT(s)->len;
MEMCPY(clone->ptr, RSTRUCT(s)->ptr, VALUE, clone->len);
return (VALUE)st;
return (VALUE)clone;
}
static VALUE