Feature #11208 ยป 0001-variable.c-remove-generic-ivar-support-for-special-c.patch
| gc.c | ||
|---|---|---|
|
MARK_CHECKPOINT("global_tbl");
|
||
|
rb_gc_mark_global_tbl();
|
||
|
/* mark generic instance variables for special constants */
|
||
|
MARK_CHECKPOINT("generic_ivars");
|
||
|
rb_mark_generic_ivar_tbl();
|
||
|
MARK_CHECKPOINT("live_method_entries");
|
||
|
rb_gc_mark_unlinked_live_method_entries(th->vm);
|
||
| internal.h | ||
|---|---|---|
|
/* variable.c (export) */
|
||
|
void rb_gc_mark_global_tbl(void);
|
||
|
void rb_mark_generic_ivar(VALUE);
|
||
|
void rb_mark_generic_ivar_tbl(void);
|
||
|
VALUE rb_const_missing(VALUE klass, VALUE name);
|
||
|
int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
|
||
| variable.c | ||
|---|---|---|
|
static int const_update(st_data_t *, st_data_t *, st_data_t, int);
|
||
|
static st_table *generic_iv_tbl;
|
||
|
static st_table *generic_iv_tbl_compat;
|
||
|
static int special_generic_ivar;
|
||
|
/* per-object */
|
||
|
struct gen_ivtbl {
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
static int
|
||
|
givar_i(st_data_t k, st_data_t v, st_data_t a)
|
||
|
{
|
||
|
VALUE obj = (VALUE)k;
|
||
|
if (rb_special_const_p(obj)) {
|
||
|
gen_ivtbl_mark((const struct gen_ivtbl *)v);
|
||
|
}
|
||
|
return ST_CONTINUE;
|
||
|
}
|
||
|
void
|
||
|
rb_mark_generic_ivar_tbl(void)
|
||
|
{
|
||
|
if (special_generic_ivar == 0) return;
|
||
|
st_foreach_safe(generic_iv_tbl, givar_i, 0);
|
||
|
}
|
||
|
void
|
||
|
rb_free_generic_ivar(VALUE obj)
|
||
|
{
|
||
| ... | ... | |
|
if (rb_special_const_p(obj)) {
|
||
|
if (rb_obj_frozen_p(obj)) rb_error_frozen("object");
|
||
|
special_generic_ivar = 1;
|
||
|
rb_bug("non-frozen special constant");
|
||
|
}
|
||
|
ivup.extended = 0;
|
||
| ... | ... | |
|
if (rb_special_const_p(clone)) {
|
||
|
if (rb_obj_frozen_p(clone)) rb_error_frozen("object");
|
||
|
special_generic_ivar = 1;
|
||
|
rb_bug("non-frozen special constant");
|
||
|
}
|
||
|
if (!FL_TEST(obj, FL_EXIVAR)) {
|
||
|
-
|
||