mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/nkf/nkf.c (rb_nkf_convert): avoid GC.
reported in [ruby-dev:36909] and patched [ruby-dev:36941] by mame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5cc0569281
commit
f850cf2866
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Oct 27 01:05:48 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/nkf/nkf.c (rb_nkf_convert): avoid GC.
|
||||||
|
reported in [ruby-dev:36909] and patched [ruby-dev:36941] by mame.
|
||||||
|
|
||||||
Sun Oct 26 21:28:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
Sun Oct 26 21:28:42 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* test/json/test_json.rb: remove dependency on permutation gem.
|
* test/json/test_json.rb: remove dependency on permutation gem.
|
||||||
|
|
|
@ -135,6 +135,7 @@ int nkf_split_options(const char *arg)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
|
rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
|
||||||
{
|
{
|
||||||
|
volatile tmp;
|
||||||
reinit();
|
reinit();
|
||||||
StringValue(opt);
|
StringValue(opt);
|
||||||
nkf_split_options(RSTRING_PTR(opt));
|
nkf_split_options(RSTRING_PTR(opt));
|
||||||
|
@ -155,7 +156,7 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src)
|
||||||
StringValue(src);
|
StringValue(src);
|
||||||
input = (unsigned char *)RSTRING_PTR(src);
|
input = (unsigned char *)RSTRING_PTR(src);
|
||||||
i_len = RSTRING_LEN(src);
|
i_len = RSTRING_LEN(src);
|
||||||
result = rb_str_new(0, i_len*3 + 10);
|
tmp = result = rb_str_new(0, i_len*3 + 10);
|
||||||
|
|
||||||
output_ctr = 0;
|
output_ctr = 0;
|
||||||
output = (unsigned char *)RSTRING_PTR(result);
|
output = (unsigned char *)RSTRING_PTR(result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue