< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #16029 has been updated by byroot (Jean Boussier).
@sam.saffron Unless I'm missing something, that's exactly what `rb_fstring_new / rb_fstring_cstr` does.
```
VALUE rb_fstring_new(const char *ptr, long len);
VALUE rb_fstring_cstr(const char *str);
```
AFAICT It does allocate an RVALUE to lookup the table, but it does it on the stack, so I think it's fine GC wise.
----------------------------------------
Feature #16029: Expose fstring related APIs to C-extensions
https://bugs.ruby-lang.org/issues/16029#change-81952
* 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/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>