From: rubygems@wanko.cc
To: ruby-core@ruby-lang.org
Subject: [ruby-core:80451] [Ruby trunk Feature#13381] [PATCH] Expose rb_fstring and its family to C extensions
Date: Wed, 29 Mar 2017 06:32:57 +0000 [thread overview]
Message-ID: <redmine.journal-63942.20170329063256.c2a1f3ad23d376db@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13381.20170329052912@ruby-lang.org
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/
next prev parent reply other threads:[~2017-03-29 5:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-13381.20170329052912@ruby-lang.org>
2017-03-29 5:29 ` [ruby-core:80447] [Ruby trunk Feature#13381] [PATCH] Expose rb_fstring and its family to C extensions eagletmt
2017-03-29 5:36 ` [ruby-core:80448] [Ruby trunk Feature#13381][Feedback] " ko1
2017-03-29 6:32 ` rubygems [this message]
2017-06-16 7:58 ` [ruby-core:81703] [Ruby trunk Feature#13381][Assigned] " ko1
2017-06-16 8:00 ` [ruby-core:81704] [Ruby trunk Feature#13381] " nobu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-63942.20170329063256.c2a1f3ad23d376db@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).