summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-09-26 23:07:37 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-10-01 16:24:43 +0900
commit7edbe428caca6814841195a3f2720745cf04353e (patch)
treeba57b813d080cce44eea564760cb7dad4cf941ca /src/state.c
parent473b7d0efd210290d1093201254fa32b5473d5d1 (diff)
downloadmruby-7edbe428caca6814841195a3f2720745cf04353e.tar.gz
mruby-7edbe428caca6814841195a3f2720745cf04353e.zip
Add new type of shared string: `RSTR_FSHARED`.
`RSTR_FSHARED` use frozen strings as shared body instead of `struct mrb_shared_string`. This reduces allocation from literal strings.
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index 463fa9059..2f66e494b 100644
--- a/src/state.c
+++ b/src/state.c
@@ -237,6 +237,7 @@ mrb_str_pool(mrb_state *mrb, mrb_value str)
ns->as.heap.ptr[len] = '\0';
}
}
+ MRB_SET_FROZEN_FLAG(ns);
return mrb_obj_value(ns);
}