summaryrefslogtreecommitdiff
path: root/imemo.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-18 09:26:34 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-09-19 08:46:09 -0400
commit477b1e79b71af422136df29b259d9bb3ce8449e2 (patch)
treec09c9da1d8b8109cf71922a64dc56f0d8d2d1b3c /imemo.c
parentbb25ed61094d4bd1400670a6fbbfc5e6537a7ffb (diff)
Directly use rb_imemo_new in imemo_fields_new_complex
We should not assume that a complex imemo_field takes only one additional VALUE space. This is fragile as it will break if we add additional fields to complex imemo_field.
Diffstat (limited to 'imemo.c')
-rw-r--r--imemo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imemo.c b/imemo.c
index 10ac960095..5a5ec4a4d3 100644
--- a/imemo.c
+++ b/imemo.c
@@ -123,7 +123,7 @@ rb_imemo_fields_new(VALUE owner, size_t capa)
static VALUE
imemo_fields_new_complex(VALUE owner, size_t capa)
{
- VALUE fields = imemo_fields_new(owner, 1);
+ VALUE fields = rb_imemo_new(imemo_fields, owner, sizeof(struct rb_fields));
IMEMO_OBJ_FIELDS(fields)->as.complex.table = st_init_numtable_with_size(capa);
FL_SET_RAW(fields, OBJ_FIELD_HEAP);
return fields;