diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-26 23:07:37 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-01 16:24:43 +0900 |
| commit | 7edbe428caca6814841195a3f2720745cf04353e (patch) | |
| tree | ba57b813d080cce44eea564760cb7dad4cf941ca /src/state.c | |
| parent | 473b7d0efd210290d1093201254fa32b5473d5d1 (diff) | |
| download | mruby-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.c | 1 |
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); } |
