mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
merge revision(s) 42212,42214: [Backport #8669]
* string.c: add internal API rb_str_locktmp_ensure(). * io.c (io_fread): use rb_str_locktmp_ensure(). [ruby-core:56121] [Bug #8669] * test/ruby/test_io.rb: add a test for above. * io.c (io_getpartial): use rb_str_locktmp_ensure(). [ruby-core:56121] [Bug #8669] * io.c (rb_io_sysread): ditto. * test/ruby/test_io.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0f1fb6ff36
commit
a728dd2584
6 changed files with 115 additions and 9 deletions
7
string.c
7
string.c
|
@ -1826,6 +1826,13 @@ rb_str_unlocktmp(VALUE str)
|
|||
return str;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg)
|
||||
{
|
||||
rb_str_locktmp(str);
|
||||
return rb_ensure(func, arg, rb_str_unlocktmp, str);
|
||||
}
|
||||
|
||||
void
|
||||
rb_str_set_len(VALUE str, long len)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue