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 5B3561F4B4 for ; Wed, 23 Sep 2020 07:24:06 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D1AE8120A78; Wed, 23 Sep 2020 16:23:29 +0900 (JST) 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 504DC120A77 for ; Wed, 23 Sep 2020 16:23:27 +0900 (JST) Received: by filterdrecv-p3mdw1-5dd6bc5999-grd7s with SMTP id filterdrecv-p3mdw1-5dd6bc5999-grd7s-19-5F6AF80F-11 2020-09-23 07:23:59.260797877 +0000 UTC m=+120326.551287762 Received: from herokuapp.com (unknown) by geopod-ismtpd-4-6 (SG) with ESMTP id qJ5I_3L2StW0dJLmQGIxBw for ; Wed, 23 Sep 2020 07:23:59.175 +0000 (UTC) Date: Wed, 23 Sep 2020 07:23:59 +0000 (UTC) From: jean.boussier@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75924 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?AchqQMoUBMcQgz7gop0XiYUiatGIY7E61JGsTL4FvjeIAP9JaXlyi2evXO+0qL?= =?us-ascii?Q?nyVKt8nAzwTKhIltULd6BLc1+HAExV+rYLO5Z=2FR?= =?us-ascii?Q?WsnVOSwELHW7ccL+2cSqd4L8d+f3UBk0F5ojfO6?= =?us-ascii?Q?qXSBulbUPqj0+kiW6mA+54DdqaTZ=2FCZBatMfcip?= =?us-ascii?Q?52OFkOx=2FniR8jv8tfzUZsT+CRiFn7EO3sYykHDU?= =?us-ascii?Q?fqWiEfufw96D=2FlmVg=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 100084 Subject: [ruby-core:100084] [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). Would you like a patch? ---------------------------------------- Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions https://bugs.ruby-lang.org/issues/13381#change-87641 * Author: eagletmt (Kohei Suzuki) * Status: Assigned * 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/