summaryrefslogtreecommitdiff
path: root/imemo.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-09-19 09:00:58 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-09-19 11:05:43 -0400
commit1663e2fbc8f3e904266ee89ba17066c3673765a0 (patch)
tree94773440b29f7b889758f6c1ac7408e0666a7017 /imemo.c
parentb082d672533a6c0cf69c39497342cb2d5dde9f12 (diff)
Fix capacity of imemo_fields objects created from rb_imemo_fields_new_complex_tbl
The imemo_fields_new function takes a capacity in the number of fields to preallocate. rb_imemo_fields_new_complex_tbl is using it incorrectly because it is preallocating sizeof(struct rb_fields) number of fields.
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 5a5ec4a4d3..346fae3b86 100644
--- a/imemo.c
+++ b/imemo.c
@@ -153,7 +153,7 @@ imemo_fields_complex_wb_i(st_data_t key, st_data_t value, st_data_t arg)
VALUE
rb_imemo_fields_new_complex_tbl(VALUE owner, st_table *tbl)
{
- VALUE fields = imemo_fields_new(owner, sizeof(struct rb_fields));
+ VALUE fields = rb_imemo_new(imemo_fields, owner, sizeof(struct rb_fields));
IMEMO_OBJ_FIELDS(fields)->as.complex.table = tbl;
FL_SET_RAW(fields, OBJ_FIELD_HEAP);
st_foreach(tbl, imemo_fields_trigger_wb_i, (st_data_t)fields);