aboutsummaryrefslogtreecommitdiffstats
path: root/load.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-01 01:16:26 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-01 01:16:26 +0000
commitd6a14b46a75d677c86c1b57761fccc3793145deb (patch)
tree34573ce37de4d4c37267072b26d839bb467860ad /load.c
parent87d0c73bfeea538cf885d504cb126eef91ed7b0e (diff)
downloadruby-d6a14b46a75d677c86c1b57761fccc3793145deb.tar.gz
deduplicate strings sooner at load and compile
We can use rb_fstring_cstr in some places to prevent an intermediate object from being created before deduplication via rb_fstring. * compile.c (iseq_compile_each): use rb_fstring_cstr (rb_insns_name_array): ditto * load.c (rb_load_internal0): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r--load.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/load.c b/load.c
index 854d56a9d9..284ebf2e48 100644
--- a/load.c
+++ b/load.c
@@ -612,7 +612,8 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
VALUE parser = rb_parser_new();
rb_parser_set_context(parser, NULL, FALSE);
node = (NODE *)rb_parser_load_file(parser, fname);
- iseq = rb_iseq_new_top(node, rb_str_new2("<top (required)>"), fname, rb_realpath_internal(Qnil, fname, 1), NULL);
+ iseq = rb_iseq_new_top(node, rb_fstring_cstr("<top (required)>"),
+ fname, rb_realpath_internal(Qnil, fname, 1), NULL);
}
rb_iseq_eval(iseq);
}