summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-09 04:32:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-09 04:32:24 +0000
commite0208c14e0e8161f80c14624a5d4a1f544a74a70 (patch)
treecf8d2904f1e9ba1a42b0e68e59571e97c3695f2b /struct.c
parent2eb957394cc2120ba77e6a3bf367d029a148ca3a (diff)
downloadruby-e0208c14e0e8161f80c14624a5d4a1f544a74a70.tar.gz
ruby-e0208c14e0e8161f80c14624a5d4a1f544a74a70.tar.xz
ruby-e0208c14e0e8161f80c14624a5d4a1f544a74a70.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 977d41121..31103a452 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);