aboutsummaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-06-12 13:13:32 +0100
committerJean Boussier <jean.boussier@gmail.com>2023-06-12 16:20:05 +0200
commit6fe46ff967215e47ab2234e9b48663d2e3608081 (patch)
tree9c0c73d916c070a2e6b89265736aa0620ee283ff /struct.c
parent31e24a42f3c351fc306147b08fb7442d272d39f8 (diff)
downloadruby-6fe46ff967215e47ab2234e9b48663d2e3608081.tar.gz
When alloc size is too large, only allocate struct
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 3ee4408393..7214402f59 100644
--- a/struct.c
+++ b/struct.c
@@ -849,7 +849,7 @@ struct_alloc(VALUE klass)
return (VALUE)st;
}
else {
- NEWOBJ_OF(st, struct RStruct, klass, flags, embedded_size, 0);
+ NEWOBJ_OF(st, struct RStruct, klass, flags, sizeof(struct RStruct), 0);
st->as.heap.ptr = struct_heap_alloc((VALUE)st, n);
rb_mem_clear((VALUE *)st->as.heap.ptr, n);