Skip to content

Commit 1663e2f

Browse files
committed
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.
1 parent b082d67 commit 1663e2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imemo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ imemo_fields_complex_wb_i(st_data_t key, st_data_t value, st_data_t arg)
153153
VALUE
154154
rb_imemo_fields_new_complex_tbl(VALUE owner, st_table *tbl)
155155
{
156-
VALUE fields = imemo_fields_new(owner, sizeof(struct rb_fields));
156+
VALUE fields = rb_imemo_new(imemo_fields, owner, sizeof(struct rb_fields));
157157
IMEMO_OBJ_FIELDS(fields)->as.complex.table = tbl;
158158
FL_SET_RAW(fields, OBJ_FIELD_HEAP);
159159
st_foreach(tbl, imemo_fields_trigger_wb_i, (st_data_t)fields);

0 commit comments

Comments
 (0)