mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a1d1b15167
commit
de71615260
69 changed files with 1873 additions and 1103 deletions
14
struct.c
14
struct.c
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue