mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6bb525282c
commit
0861165bdc
11 changed files with 711 additions and 707 deletions
8
struct.c
8
struct.c
|
@ -210,9 +210,9 @@ struct_alloc(klass, values)
|
|||
else {
|
||||
NEWOBJ(st, struct RStruct);
|
||||
OBJSETUP(st, klass, T_STRUCT);
|
||||
st->len = n;
|
||||
st->ptr = 0; /* avoid GC crashing */
|
||||
st->len = 0; /* avoid GC crashing */
|
||||
st->ptr = ALLOC_N(VALUE, n);
|
||||
st->len = n;
|
||||
MEMCPY(st->ptr, RARRAY(values)->ptr, VALUE, RARRAY(values)->len);
|
||||
memclear(st->ptr+RARRAY(values)->len, n - RARRAY(values)->len);
|
||||
|
||||
|
@ -318,9 +318,9 @@ struct_clone(s)
|
|||
{
|
||||
NEWOBJ(st, struct RStruct);
|
||||
CLONESETUP(st, s);
|
||||
st->len = RSTRUCT(s)->len;
|
||||
st->ptr = 0; /* avoid GC crashing */
|
||||
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);
|
||||
|
||||
return (VALUE)st;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue