From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 3EC2D1B61D59 for ; Wed, 29 Mar 2017 14:56:53 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 3F46CB5D868 for ; Wed, 29 Mar 2017 15:33:06 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 9FA6518CC7B1 for ; Wed, 29 Mar 2017 15:33:06 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 06173120704; Wed, 29 Mar 2017 15:33:06 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id C8D9B1206A6 for ; Wed, 29 Mar 2017 15:33:01 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=035syVzjHv8mnP88T9nWL7gOFTE=; b=kxG1eChJCZlxvFGxrl XHHKXsrvsxz7iOmR88TZTSUfERuB9kBE31Aqbb3N92PeUt/UEVDT4OuVMfTQwvGN cQimA63a125Qt8y/YmIY4EUrhK5QYZn72Q3ghbheUfHBScdLQ8VCgFxl9RQ2SyTH ljaTGx9BufCQLvIhQNfX9y7Kc= Received: by filter0474p1mdw1.sendgrid.net with SMTP id filter0474p1mdw1-28588-58DB5519-1B 2017-03-29 06:32:57.370812455 +0000 UTC Received: from herokuapp.com (ec2-54-166-105-46.compute-1.amazonaws.com [54.166.105.46]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 46WUcnkIT2uitWEhybiTvA for ; Wed, 29 Mar 2017 06:32:57.296 +0000 (UTC) Date: Wed, 29 Mar 2017 06:32:57 +0000 From: rubygems@wanko.cc To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 55423 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13381 X-Redmine-Issue-Author: eagletmt X-Redmine-Sender: eagletmt X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6Uh3BQOpP7j/gP1YOqX4hPqVY+e3a9dW7LkG YoVBx+smPS/XNqWSCp+KbbI9JRGHdW/21yb2kg633lhnBBOtaww1/xYr+beZrpHTVc/MnXQKMkNb5J OE+ahmZtxT+WNeUyKRq8fzFXhqZZfHTJU9HLcM+4QWq2/275llHXlewEBg== X-ML-Name: ruby-core X-Mail-Count: 80451 Subject: [ruby-core:80451] [Ruby trunk Feature#13381] [PATCH] Expose rb_fstring and its family to C extensions X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13381 has been updated by eagletmt (Kohei Suzuki). OK, I've read comments of #13077. What do you think of renaming fstring to "deduped" string? "Deduped" strings are implicitly frozen. - Rename `rb_fstring` to `rb_str_deduped` - Rename `rb_fstring_new` to `rb_str_deduped_new` - Rename `rb_fstring_cstr` to `rb_str_deduped_cstr` - Rename `rb_fstring_enc_new` to `rb_enc_str_deduped_new` - Rename `rb_fstring_enc_cstr` to `rb_enc_str_deduped_cstr` - I think `enc` should come first for consistency ---------------------------------------- Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions https://bugs.ruby-lang.org/issues/13381#change-63942 * Author: eagletmt (Kohei Suzuki) * Status: Feedback * Priority: Normal * Assignee: * Target version: ---------------------------------------- https://github.com/ruby/ruby/pull/1559 Currently, C extensions cannot use fstrings. I'd like to use `rb_fstring_cstr` instead of `rb_str_new_cstr` for static strings in C extensions to avoid excess allocation. I think there's several use cases. - https://github.com/k0kubun/hamlit/blob/v2.8.0/ext/hamlit/hamlit.c#L508-L512 - https://bitbucket.org/ged/ruby-pg/src/e5eb92cca97abc0c6fc168acfad993c2ad314589/ext/pg_connection.c?at=v0.20.0&fileviewer=file-view-default#pg_connection.c-3679 - https://bitbucket.org/ged/ruby-pg/src/e5eb92cca97abc0c6fc168acfad993c2ad314589/ext/pg_copy_coder.c?at=v0.20.0&fileviewer=file-view-default#pg_copy_coder.c-38 -- https://bugs.ruby-lang.org/