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-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.8 required=3.0 tests=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 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 A98FC1F463 for ; Sun, 5 Jan 2020 00:58:39 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4ADB91209D8; Sun, 5 Jan 2020 09:58:22 +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 543841209D0 for ; Sun, 5 Jan 2020 09:58:20 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-s82th with SMTP id filterdrecv-p3mdw1-56c97568b5-s82th-20-5E1134AE-1D 2020-01-05 00:58:22.375896852 +0000 UTC m=+1642512.350595397 Received: from herokuapp.com (unknown [3.84.47.179]) by ismtpd0010p1iad2.sendgrid.net (SG) with ESMTP id r7Sgi3BaT0ifqyFv9siYvA for ; Sun, 05 Jan 2020 00:58:22.034 +0000 (UTC) Date: Sun, 05 Jan 2020 00:58:22 +0000 (UTC) From: sam.saffron@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72328 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 16029 X-Redmine-Issue-Author: byroot X-Redmine-Sender: sam.saffron 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?GD31AXMrLYtZC3ZmvheLkg5nAqKYtjT=2Fa5aksj98ZWPZFvgiVClUsC4g2+LGKD?= =?us-ascii?Q?AejbdByQcF6vMg8GbHAa7Ky7RGhWNHYY=2FiJva2y?= =?us-ascii?Q?IqQbG1Ff9pgObO8vH9Y+r7KuYsM3dM3Nn5jS3f8?= =?us-ascii?Q?t+ZXd1GoLBEHxhr+84iI5sHmLW6NqkbfWfNAKZk?= =?us-ascii?Q?lVuVAgPtrMeN16x4Ya2=2FcLoMIKPxE3kqvyyC9+q?= =?us-ascii?Q?QbzoWlFNP8wFlskjk=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96666 Subject: [ruby-core:96666] [Ruby master Feature#16029] Expose fstring related APIs 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 #16029 has been updated by sam.saffron (Sam Saffron). @byroot, yeah. `rb_funcall(str, rb_intern("-@"))` works and is backwards compatible, but I entirely agree that it makes sense to add an official API as well that does not depend on dynamic invocation. ---------------------------------------- Feature #16029: Expose fstring related APIs to C-extensions https://bugs.ruby-lang.org/issues/16029#change-83648 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- As discussed with @tenderlove here: https://github.com/ruby/ruby/pull/2287#issuecomment-513865160 We'd like to update various data format parsers (JSON, MessagePack, etc) to add the possibility to deduplicate strings while parsing. But unfortunately the `rb_fstring_*` family of functions isn't available to C-extensions, so the only available fallback is `rb_funcall(str, rb_intern("-@"))` which most parsers will likely consider too slow. So the various `rb_fstring_*` functions would need to be public. Proposed patch: https://github.com/ruby/ruby/pull/2299 -- https://bugs.ruby-lang.org/