From 9832e91304347a12e4a2fc53d38a0b1f2486b958 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Fri, 16 Aug 2019 22:05:58 +0900 Subject: 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. --- src/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gc.c') 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); } -- cgit v1.2.3