From 7edbe428caca6814841195a3f2720745cf04353e Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 26 Sep 2017 23:07:37 +0900 Subject: 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. --- src/state.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/state.c') 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); } -- cgit v1.2.3