diff --git a/node.c b/node.c index 9521238e38..79ef00f1b7 100644 --- a/node.c +++ b/node.c @@ -321,7 +321,6 @@ rb_ast_t * rb_ast_new(rb_parser_config_t *config) { node_buffer_t *nb = rb_node_buffer_new(config); - config->counter++; return config->ast_new((VALUE)nb); } #else diff --git a/parse.y b/parse.y index 23ca4c8ddc..6ebb237181 100644 --- a/parse.y +++ b/parse.y @@ -15970,7 +15970,6 @@ rb_ruby_parser_allocate(rb_parser_config_t *config) /* parser_initialize expects fields to be set to 0 */ rb_parser_t *p = (rb_parser_t *)config->calloc(1, sizeof(rb_parser_t)); p->config = config; - p->config->counter++; return p; } diff --git a/ruby_parser.c b/ruby_parser.c index 9f9b680646..47dc54df6c 100644 --- a/ruby_parser.c +++ b/ruby_parser.c @@ -618,8 +618,6 @@ extern VALUE rb_mRubyVMFrozenCore; VALUE rb_node_case_when_optimizable_literal(const NODE *const node); rb_parser_config_t rb_global_parser_config = (rb_parser_config_t) { - .counter = 0, - .malloc = ruby_xmalloc, .calloc = ruby_xcalloc, .realloc = ruby_xrealloc, diff --git a/rubyparser.h b/rubyparser.h index e78df79e7a..974a03992c 100644 --- a/rubyparser.h +++ b/rubyparser.h @@ -1194,14 +1194,6 @@ typedef struct rb_imemo_tmpbuf_struct rb_imemo_tmpbuf_t; #ifdef UNIVERSAL_PARSER typedef struct rb_parser_config_struct { - /* - * Reference counter. - * This is needed because both parser and ast refer - * same config pointer. - * We can remove this, once decuple parser and ast from Ruby GC. - */ - int counter; - /* Memory */ void *(*malloc)(size_t size); void *(*calloc)(size_t number, size_t size);