diff options
author | Matt Valentine-House <[email protected]> | 2023-06-12 13:13:32 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2023-06-12 16:20:05 +0200 |
commit | 6fe46ff967215e47ab2234e9b48663d2e3608081 (patch) | |
tree | 9c0c73d916c070a2e6b89265736aa0620ee283ff /struct.c | |
parent | 31e24a42f3c351fc306147b08fb7442d272d39f8 (diff) |
When alloc size is too large, only allocate struct
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7933
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |