[前][次][番号順一覧][スレッド一覧]

ruby-changes:49566

From: mame <ko1@a...>
Date: Mon, 8 Jan 2018 18:39:07 +0900 (JST)
Subject: [ruby-changes:49566] mame:r61682 (trunk): parse.y: Remove dispose_string

mame	2018-01-08 18:39:01 +0900 (Mon, 08 Jan 2018)

  New Revision: 61682

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61682

  Log:
    parse.y: Remove dispose_string
    
    I think that recycling the delimiter string objects doesn't pay its
    complexity.

  Modified files:
    trunk/node.c
    trunk/node.h
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 61681)
+++ parse.y	(revision 61682)
@@ -6123,14 +6123,6 @@ parser_regx_options(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L6123
     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_param https://github.com/ruby/ruby/blob/trunk/parse.y#L6899
 	    }
 	    if (nextc() == -1) {
 		if (str) {
-		    dispose_string(parser, str);
 		    str = 0;
 		}
 		goto error;
Index: node.c
===================================================================
--- node.c	(revision 61681)
+++ node.c	(revision 61682)
@@ -1136,14 +1136,3 @@ rb_ast_add_mark_object(rb_ast_t *ast, VA https://github.com/ruby/ruby/blob/trunk/node.c#L1136
 {
     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);
-	}
-    }
-}
Index: node.h
===================================================================
--- node.h	(revision 61681)
+++ node.h	(revision 61682)
@@ -479,7 +479,6 @@ void rb_ast_mark(rb_ast_t*); https://github.com/ruby/ruby/blob/trunk/node.h#L479
 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);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]