diff --git a/node.c b/node.c index 370e6df5ce..abaaf19c7d 100644 --- a/node.c +++ b/node.c @@ -1136,14 +1136,3 @@ rb_ast_add_mark_object(rb_ast_t *ast, VALUE obj) { rb_ary_push(ast->mark_ary, obj); } - -void -rb_ast_delete_mark_object(rb_ast_t *ast, VALUE obj) -{ - long i; - for (i = 0; i < RARRAY_LEN(ast->mark_ary); i++) { - if (obj == RARRAY_AREF(ast->mark_ary, i)) { - RARRAY_ASET(ast->mark_ary, i, Qnil); - } - } -} diff --git a/node.h b/node.h index 488a8ce2ef..b18d96357a 100644 --- a/node.h +++ b/node.h @@ -479,7 +479,6 @@ void rb_ast_mark(rb_ast_t*); void rb_ast_dispose(rb_ast_t*); void rb_ast_free(rb_ast_t*); void rb_ast_add_mark_object(rb_ast_t*, VALUE); -void rb_ast_delete_mark_object(rb_ast_t*, VALUE); NODE *rb_ast_newnode(rb_ast_t*); void rb_ast_delete_node(rb_ast_t*, NODE *n); diff --git a/parse.y b/parse.y index e73c266cc2..95c7f9bf12 100644 --- a/parse.y +++ b/parse.y @@ -6123,14 +6123,6 @@ parser_regx_options(struct parser_params *parser) return options | RE_OPTION_ENCODING(kcode); } -static void -dispose_string(struct parser_params *parser, VALUE str) -{ - rb_ast_delete_mark_object(parser->ast, str); - rb_str_free(str); - rb_gc_force_recycle(str); -} - static int parser_tokadd_mbchar(struct parser_params *parser, int c) { @@ -6907,7 +6899,6 @@ parser_here_document(struct parser_params *parser, rb_strterm_heredoc_t *here) } if (nextc() == -1) { if (str) { - dispose_string(parser, str); str = 0; } goto error;