From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 636721F86C for ; Thu, 26 Nov 2020 19:03:04 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id C3032120A27; Fri, 27 Nov 2020 04:02:18 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id EE991120A20 for ; Fri, 27 Nov 2020 04:02:15 +0900 (JST) Received: by filterdrecv-p3iad2-5dc87598f5-tptwj with SMTP id filterdrecv-p3iad2-5dc87598f5-tptwj-18-5FBFFBDC-77 2020-11-26 19:02:52.274934939 +0000 UTC m=+858730.794022670 Received: from herokuapp.com (unknown) by ismtpd0103p1iad2.sendgrid.net (SG) with ESMTP id A7rjDJukRBCWXvi0TfBYaw for ; Thu, 26 Nov 2020 19:02:52.267 +0000 (UTC) Date: Thu, 26 Nov 2020 19:02:52 +0000 (UTC) From: jean.boussier@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76978 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 13381 X-Redmine-Issue-Author: eagletmt X-Redmine-Sender: byroot 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: =?us-ascii?Q?AchqQMoUBMcQgz7gop0XiYUiatGIY7E61JGsTL4FvjcJymtiqnf40Vu3WtSnIu?= =?us-ascii?Q?kJCg0JYHrywgdV=2Fb+jFbr9tlqqLAZiinXaZAOat?= =?us-ascii?Q?YPaES5jw3KNb22JDeuA4RZtzVr5ZvAeFfw908cG?= =?us-ascii?Q?GDYbRO2gFtigigwKQupsGcdwY3LSCayoLurS8M5?= =?us-ascii?Q?PMtdMF6LltDgzX5pMXotfijivAUl9QuRWolFlQ4?= =?us-ascii?Q?u0=2FeEpgWp97976BTk=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101104 Subject: [ruby-core:101104] [Ruby master 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 byroot (Jean Boussier). Also if that helps, here's how it would be used by `json`: https://github.com/flori/json/pull/451 ---------------------------------------- Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions https://bugs.ruby-lang.org/issues/13381#change-88779 * Author: eagletmt (Kohei Suzuki) * Status: Closed * Priority: Normal ---------------------------------------- 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/