mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
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.
This commit is contained in:
parent
b082d67253
commit
1663e2fbc8
2
imemo.c
2
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user