From 6fe46ff967215e47ab2234e9b48663d2e3608081 Mon Sep 17 00:00:00 2001 From: Matt Valentine-House Date: Mon, 12 Jun 2023 13:13:32 +0100 Subject: When alloc size is too large, only allocate struct --- struct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'struct.c') 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); -- cgit v1.2.3