summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index 977d411211..31103a452b 100644
--- a/struct.c
+++ b/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);