From fb01411ae842dbcc16d18dec2216fa2719649dff Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 18 Jun 2021 01:31:50 +0900 Subject: node.h: Reduce struct size to fit with Ruby object size (five VALUEs) by merging `rb_ast_body_t#line_count` and `#script_lines`. Fortunately `line_count == RARRAY_LEN(script_lines)` was always satisfied. When script_lines is saved, it has an array of lines, and when not saved, it has a Fixnum that represents the old line_count. --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 47b63e810d..df16cf6236 100644 --- a/parse.y +++ b/parse.y @@ -6286,7 +6286,7 @@ yycompile0(VALUE arg) RB_OBJ_WRITE(p->ast, &p->ast->body.compile_option, opt); } p->ast->body.root = tree; - p->ast->body.line_count = p->line_count; + if (!p->ast->body.script_lines) p->ast->body.script_lines = INT2FIX(p->line_count); return TRUE; } -- cgit v1.2.3