ruby-changes:49912
From: normal <ko1@a...>
Date: Thu, 25 Jan 2018 07:40:06 +0900 (JST)
Subject: [ruby-changes:49912] normal:r62030 (trunk): load.c: use fstring instead of OBJ_FREEZE
normal 2018-01-25 07:39:56 +0900 (Thu, 25 Jan 2018) New Revision: 62030 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62030 Log: load.c: use fstring instead of OBJ_FREEZE These strings already exist (or will exist soon) in the fstring table, so avoid the duplicate, sooner. Modified files: trunk/encoding.c Index: encoding.c =================================================================== --- encoding.c (revision 62029) +++ encoding.c (revision 62030) @@ -661,7 +661,7 @@ load_encoding(const char *name) https://github.com/ruby/ruby/blob/trunk/encoding.c#L661 ++s; } FL_UNSET(enclib, FL_TAINT); - OBJ_FREEZE(enclib); + enclib = rb_fstring(enclib); ruby_verbose = Qfalse; ruby_debug = Qfalse; errinfo = rb_errinfo(); @@ -1162,8 +1162,7 @@ enc_names_i(st_data_t name, st_data_t id https://github.com/ruby/ruby/blob/trunk/encoding.c#L1162 VALUE *arg = (VALUE *)args; if ((int)idx == (int)arg[0]) { - VALUE str = rb_usascii_str_new2((char *)name); - OBJ_FREEZE(str); + VALUE str = rb_fstring_cstr((char *)name); rb_ary_push(arg[1], str); } return ST_CONTINUE; @@ -1697,8 +1696,7 @@ rb_enc_aliases_enc_i(st_data_t name, st_ https://github.com/ruby/ruby/blob/trunk/encoding.c#L1696 str = rb_fstring_cstr(rb_enc_name(enc)); rb_ary_store(ary, idx, str); } - key = rb_usascii_str_new2((char *)name); - OBJ_FREEZE(key); + key = rb_fstring_cstr((char *)name); rb_hash_aset(aliases, key, str); return ST_CONTINUE; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/