aboutsummaryrefslogtreecommitdiffstats
path: root/compile.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 /compile.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 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 811160ad11..68aeb4cfce 100644
--- a/compile.c
+++ b/compile.c
@@ -5971,7 +5971,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int poppe
}
case NODE_SCLASS:{
ID singletonclass;
- const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_str_new2("singleton class"),
+ const rb_iseq_t *singleton_class = NEW_ISEQ(node->nd_body, rb_fstring_cstr("singleton class"),
ISEQ_TYPE_CLASS, line);
CHECK(COMPILE(ret, "sclass#recv", node->nd_recv));
@@ -6515,7 +6515,7 @@ rb_insns_name_array(void)
VALUE ary = rb_ary_new();
int i;
for (i = 0; i < numberof(insn_name_info); i++) {
- rb_ary_push(ary, rb_fstring(rb_str_new2(insn_name_info[i])));
+ rb_ary_push(ary, rb_fstring_cstr(insn_name_info[i]));
}
return rb_obj_freeze(ary);
}