From: Eric Wong Date: 2013-10-09T02:25:47+00:00 Subject: [ruby-core:57757] Re: [ruby-trunk - Feature #8992] Use String#freeze and compiler tricks to replace "str"f suffix "headius (Charles Nutter)" wrote: > So here's the same question I asked in the #frozen feature: why can't > #freeze just use the fstring table? That would be an interesting experiment. After all, it is #freeze and not #freeze!, so maybe we have some leverage there. > * fstrings will GC and clear themselves from that table I think this needs some work for the non-parser case, there seems to be a bad interaction with lazy sweep. My analysis of my failed patch for Feature #8998: http://mid.gmane.org/20131009021547.GA1839@dcvr.yhbt.net I also get (identical?) segfaults with the following: diff --git a/object.c b/object.c --- a/object.c +++ b/object.c @@ -1029,6 +1029,8 @@ VALUE rb_obj_freeze(VALUE obj) { if (!OBJ_FROZEN(obj)) { + if (TYPE(obj) == T_STRING) + return rb_fstring(obj); OBJ_FREEZE(obj); if (SPECIAL_CONST_P(obj)) { if (!immediate_frozen_tbl) {