mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3edeb5fec
commit
c1bbe10599
12 changed files with 40 additions and 43 deletions
2
struct.c
2
struct.c
|
@ -281,7 +281,6 @@ struct_alloc(argc, argv, klass)
|
|||
size = iv_get(klass, "__size__");
|
||||
n = FIX2LONG(size);
|
||||
|
||||
st->len = 0; /* avoid GC crashing */
|
||||
st->ptr = ALLOC_N(VALUE, n);
|
||||
rb_mem_clear(st->ptr, n);
|
||||
st->len = n;
|
||||
|
@ -408,7 +407,6 @@ rb_struct_clone(s)
|
|||
{
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue