From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.kcar.general Subject: Re: [PATCH] use rb_fstring from Ruby 2.1.0dev if available Date: Sat, 12 Oct 2013 06:59:40 +0000 Message-ID: <20131012065940.GA13867@dcvr.yhbt.net> References: <1381547916-7599-1-git-send-email-normalperson@yhbt.net> Reply-To: kcar@librelist.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381561191 31959 80.91.229.3 (12 Oct 2013 06:59:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2013 06:59:51 +0000 (UTC) To: kcar@librelist.org Original-X-From: kcar@librelist.org Sat Oct 12 08:59:56 2013 Return-path: Envelope-to: gclrkg-kcar@m.gmane.org List-Archive: List-Help: List-Id: kcar@librelist.org List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kcar@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.kcar.general:13 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VUtB4-0005K5-80 for gclrkg-kcar@m.gmane.org; Sat, 12 Oct 2013 08:59:54 +0200 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 6027974FD5 for ; Sat, 12 Oct 2013 07:00:26 +0000 (UTC) Eric Wong wrote: > This should be safe after r43210 from ruby trunk Ugh, that was a horrible commit message. This uses the frozen string cache in Ruby 2.1.0 if available. The frozen string cache implements the: "literal string"f syntax found in Ruby 2.1.0 (this Ruby syntax is not set-in-stone, but the idea of the frozen string cache seems to be popular in ruby-core right now and unlikely to go away). Strings in the frozen string cache benefit from best-effort deduplication, but can still be GC-ed (unlike Symbols). Obviously they are strings, too, so they're usable for Rack headers.