diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-05-11 13:30:40 -0700 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-05-11 13:31:00 -0700 |
commit | 07f055bb132f21fd71af2720382ad8d2e8f69e47 (patch) | |
tree | 9fc22fdb5d081e61311092ca261214f31e7e278e /gc.c | |
parent | 08de37f9fa3469365e6b5c964689ae2bae0eb9f3 (diff) |
Revert "Filling cache values on cvar write"
This reverts commit 08de37f9fa3469365e6b5c964689ae2bae0eb9f3.
This reverts commit e8ae922b62adb00a80d3d4c49f7d7b0e6026eaba.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -3003,13 +3003,6 @@ cc_table_free(rb_objspace_t *objspace, VALUE klass, bool alive) } } -static enum rb_id_table_iterator_result -cvar_table_free_i(VALUE value, void * ctx) -{ - xfree((void *) value); - return ID_TABLE_CONTINUE; -} - void rb_cc_table_free(VALUE klass) { @@ -3121,10 +3114,6 @@ obj_free(rb_objspace_t *objspace, VALUE obj) if (RCLASS_IV_INDEX_TBL(obj)) { iv_index_tbl_free(RCLASS_IV_INDEX_TBL(obj)); } - if (RCLASS_CVC_TBL(obj)) { - rb_id_table_foreach_values(RCLASS_CVC_TBL(obj), cvar_table_free_i, NULL); - rb_id_table_free(RCLASS_CVC_TBL(obj)); - } if (RCLASS_SUBCLASSES(obj)) { if (BUILTIN_TYPE(obj) == T_MODULE) { rb_class_detach_module_subclasses(obj); @@ -4568,9 +4557,6 @@ obj_memsize_of(VALUE obj, int use_all_types) if (RCLASS_IV_TBL(obj)) { size += st_memsize(RCLASS_IV_TBL(obj)); } - if (RCLASS_CVC_TBL(obj)) { - size += rb_id_table_memsize(RCLASS_CVC_TBL(obj)); - } if (RCLASS_IV_INDEX_TBL(obj)) { // TODO: more correct value size += st_memsize(RCLASS_IV_INDEX_TBL(obj)); @@ -9618,27 +9604,6 @@ update_cc_tbl(rb_objspace_t *objspace, VALUE klass) } static enum rb_id_table_iterator_result -update_cvc_tbl_i(ID id, VALUE cvc_entry, void *data) -{ - struct rb_cvar_class_tbl_entry *entry; - - entry = (struct rb_cvar_class_tbl_entry *)cvc_entry; - - entry->class_value = rb_gc_location(entry->class_value); - - return ID_TABLE_CONTINUE; -} - -static void -update_cvc_tbl(rb_objspace_t *objspace, VALUE klass) -{ - struct rb_id_table *tbl = RCLASS_CVC_TBL(klass); - if (tbl) { - rb_id_table_foreach_with_replace(tbl, update_cvc_tbl_i, 0, objspace); - } -} - -static enum rb_id_table_iterator_result update_const_table(VALUE value, void *data) { rb_const_entry_t *ce = (rb_const_entry_t *)value; @@ -9709,7 +9674,6 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj) if (!RCLASS_EXT(obj)) break; update_m_tbl(objspace, RCLASS_M_TBL(obj)); update_cc_tbl(objspace, obj); - update_cvc_tbl(objspace, obj); gc_update_tbl_refs(objspace, RCLASS_IV_TBL(obj)); |