From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 428CB20282 for ; Fri, 16 Jun 2017 08:01:03 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5CEC91207F8; Fri, 16 Jun 2017 17:01:01 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 50DF21207D3 for ; Fri, 16 Jun 2017 17:00:59 +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=0Zg7V3kASn+wRTju4VYOUBMQyEc=; b=vwS11S9Ho+txoDFvtq UVUBBi9+PooMn6wextIFOwhwnyh+Eyced6+fJtUB7tDgnHorD1tQulNKi0ACej1k B1ToPdzO+3h/+8SfVJLghIjwSrejG0gw5Kn+rUm7S9oaZvn9EICtB4t9o/su0XRe xVCz0dNa+vX4ySat0Oxmu0HUU= Received: by filter1076p1mdw1.sendgrid.net with SMTP id filter1076p1mdw1-17957-59439037-51 2017-06-16 08:00:55.991766577 +0000 UTC Received: from herokuapp.com (ec2-54-166-169-114.compute-1.amazonaws.com [54.166.169.114]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id wSQHHclVScC3zjOk27OEew for ; Fri, 16 Jun 2017 08:00:55.924 +0000 (UTC) Date: Fri, 16 Jun 2017 08:00:55 +0000 From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56732 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13381 X-Redmine-Issue-Author: eagletmt X-Redmine-Sender: nobu 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4LqjM25WnyxCaiqEDg+eJcd6qxGCXccxUF4S jsxwDT014DaLxwZegraRnladuSGB4QvUgTfjASSOcWvLUEBPSGcjmcRjaNN1887gFSE9qG/hMihyz0 cQDc3pfJU3ayT1d4UKYV6MMPT08R+0HD0LUtpXsFlYXDMMKaR7sdcK3FDA== X-ML-Name: ruby-core X-Mail-Count: 81704 Subject: [ruby-core:81704] [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 nobu (Nobuyoshi Nakada). Assignee deleted (ko1 (Koichi Sasada)) How about `fixed_str`? ---------------------------------------- Feature #13381: [PATCH] Expose rb_fstring and its family to C extensions https://bugs.ruby-lang.org/issues/13381#change-65394 * Author: eagletmt (Kohei Suzuki) * Status: Assigned * 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/