Project

General

Profile

Bug #18782 » 0002-Prevent-race-between-GC-mark-and-autoload-setup.patch

ioquatix (Samuel Williams), 05/14/2022 11:05 PM

View differences:

variable.c
struct autoload_data_i *p = ptr;
rb_gc_mark_movable(p->feature);
/* allow GC to free us if no modules refer to this via autoload_const.ad */
if (ccan_list_empty(&p->constants)) {
rb_hash_delete(autoload_featuremap, p->feature);
}
}
static void
......
{
struct autoload_data_i *p = ptr;
/* we may leak some memory at VM shutdown time, no big deal */
if (ccan_list_empty(&p->constants)) {
xfree(p);
}
xfree(p);
}
static size_t
(2-2/5)