Fix gc_verify_internal_consistency error for pattern_matching in ripper
gc_verify_internal_consistency reports "found internal inconsistency" for "test_pattern_matching.rb".
gc_verify_internal_consistency
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-docker/4501173
Ruby's parser manages objects by two different ways.
RB_OBJ_WRITTEN
p->ast
mark_ast_value
rb_ast_add_mark_object
rb_hash_aset
mark_hash
However in current pattern_matching implementation
This commit fix it to be #2.
This was inconsistency however always mark_hash is made young by rb_ast_add_mark_object call then objects are not collected.
Fix gc_verify_internal_consistency error for pattern_matching in ripper
gc_verify_internal_consistencyreports "found internal inconsistency"for "test_pattern_matching.rb".
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-docker/4501173
Ruby's parser manages objects by two different ways.
RB_OBJ_WRITTENwithp->astas parentmark_ast_valuemarks objectsrb_ast_add_mark_object. This function callsrb_hash_asetthenRB_OBJ_WRITTENis called withmark_hashas parentmark_hashmarks objectsHowever in current pattern_matching implementation
rb_ast_add_mark_objectThis commit fix it to be #2.
This was inconsistency however always
mark_hashismade young by
rb_ast_add_mark_objectcall then objectsare not collected.