summaryrefslogtreecommitdiffhomepage
path: root/src/gc.c
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-08-16 22:05:58 +0900
committerKOBAYASHI Shuji <[email protected]>2019-08-16 22:05:58 +0900
commit9832e91304347a12e4a2fc53d38a0b1f2486b958 (patch)
tree5ea28204620384d800b1995d1317c99bdde0aa89 /src/gc.c
parent8fa9a7b96514524403ea46450e75aada23749051 (diff)
downloadmruby-9832e91304347a12e4a2fc53d38a0b1f2486b958.tar.gz
mruby-9832e91304347a12e4a2fc53d38a0b1f2486b958.zip
SHARED/FSHARED string is not required when sharing NOFREE string
I think the string buffer of NOFREE string always exists and does not need to be released, so it can be shared as another NOFREE string. Also changed the `mrb_shared_string` field order so that eliminate padding if `int` and `mrb_int` sizes are less than pointer size.
Diffstat (limited to 'src/gc.c')
-rw-r--r--src/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gc.c b/src/gc.c
index a7a67ebfa..211980b19 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -748,7 +748,7 @@ gc_mark_children(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
break;
case MRB_TT_STRING:
- if (RSTR_FSHARED_P(obj) && !RSTR_NOFREE_P(obj)) {
+ if (RSTR_FSHARED_P(obj)) {
struct RString *s = (struct RString*)obj;
mrb_gc_mark(mrb, (struct RBasic*)s->as.heap.aux.fshared);
}