Project

General

Profile

Actions

Feature #8998

closed

string keys for hash literals should use fstrings

Added by normalperson (Eric Wong) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
[ruby-core:57727]

Description

While we're introducing optimizations from frozen strings,
string keys inside hashes should be frozen at the compiler level
to prevent duplication.

a = { "ABC" => :t }
b = { "ABC" => :t }

# the following ought to print true
p(a.keys[0].object_id == b.keys[0].object_id)

This should introduce no incompatibilities and be transparent to users of
older rubies.


Files

hash_aset_fstring.diff (411 Bytes) hash_aset_fstring.diff proposed patch normalperson (Eric Wong), 10/09/2013 06:17 AM
hash_aset_fstring_check_fail.txt (166 KB) hash_aset_fstring_check_fail.txt "make check" output normalperson (Eric Wong), 10/09/2013 06:29 AM
hash_aset_fstring_check_bt.txt (8.07 KB) hash_aset_fstring_check_bt.txt backtrace from gdb normalperson (Eric Wong), 10/09/2013 06:29 AM

Related issues 2 (0 open2 closed)

Related to Ruby master - Misc #9188: r43870 make benchmark/bm_so_k_nucleotide.rb slowClosedtmm1 (Aman Karmani)12/01/2013Actions
Related to Ruby master - Bug #9382: [patch] add opt_aref_str and opt_aset_strClosedtmm1 (Aman Karmani)01/08/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0