Fix freeing of complex IMEMO/fields

Followup: https://github.com/ruby/ruby/pull/17863

The only fields that need cleanup are complex ones, and
the free function had to be updated.
This commit is contained in:
Jean Boussier authored and Jean Boussier committed 2026-07-15 13:13:07 +02:00
1 parent 902e86c1f5
commit 38c714f577
2 files changed
+2 -2
Notes: git 2026-07-15 11:13:39 +00:00

No files matched your search

+1 -1
View File
@@ -1380,7 +1380,7 @@ rb_gc_imemo_needs_cleanup_p(VALUE obj)
return ((rb_imemo_tmpbuf_t *)obj)->ptr != NULL;
case imemo_fields:
return FL_TEST_RAW(obj, OBJ_FIELD_HEAP);
return rb_obj_shape_complex_p(obj);
}
UNREACHABLE_RETURN(true);
}
+1 -1
View File
@@ -613,7 +613,7 @@ static inline void
imemo_fields_free(struct rb_fields *fields)
{
if (rb_obj_shape_complex_p((VALUE)fields)) {
st_free_table(&fields->as.complex.table);
st_free_embedded_table(&fields->as.complex.table);
}
}