<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby.git/io.c, branch ruby_2_4</title>
<subtitle>github.com: ruby/ruby.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/'/>
<entry>
<title>merge revision(s) 67188: [Backport #15642]</title>
<updated>2019-03-31T14:58:24+00:00</updated>
<author>
<name>usa</name>
<email>usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2019-03-31T14:58:24+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=7a27746ecebbfee90203e8f3816e6e80d6c65d3b'/>
<id>7a27746ecebbfee90203e8f3816e6e80d6c65d3b</id>
<content type='text'>
	io.c: chomp CR at the end of read buffer

	* io.c (rb_io_getline_fast): chomp CR followed by LF but separated
	  by the read buffer boundary.  [ruby-core:91707] [Bug #15642]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@67391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: chomp CR at the end of read buffer

	* io.c (rb_io_getline_fast): chomp CR followed by LF but separated
	  by the read buffer boundary.  [ruby-core:91707] [Bug #15642]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@67391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 66242: [Backport #15387]</title>
<updated>2019-01-31T10:56:17+00:00</updated>
<author>
<name>usa</name>
<email>usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2019-01-31T10:56:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=6d7cab3bd6db434f8299c1ef52aa62a92129f41b'/>
<id>6d7cab3bd6db434f8299c1ef52aa62a92129f41b</id>
<content type='text'>
	io.c (io_write_nonblock): add RB_GC_GUARD, io_fflush may switch threads

	Since io_fflush may block on mutex or rb_io_wait_readable and
	switch threads, we need to ensure the `str' VALUE returned by
	`rb_obj_as_string` is visible to GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@66965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c (io_write_nonblock): add RB_GC_GUARD, io_fflush may switch threads

	Since io_fflush may block on mutex or rb_io_wait_readable and
	switch threads, we need to ensure the `str' VALUE returned by
	`rb_obj_as_string` is visible to GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@66965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 61278,61281: [Backport #13655]</title>
<updated>2018-03-19T16:27:40+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-19T16:27:40+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=cc163957a45cc9cadb81d34b630c9f7de79c7892'/>
<id>cc163957a45cc9cadb81d34b630c9f7de79c7892</id>
<content type='text'>
	IO.new doesn't recive "-" as external_encoding [Bug #13655]

	[DOC] `IO.new` accepts `external_encoding`

	Revert part of r61278 [Bug #13655]
	[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	IO.new doesn't recive "-" as external_encoding [Bug #13655]

	[DOC] `IO.new` accepts `external_encoding`

	Revert part of r61278 [Bug #13655]
	[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 60294: [Backport #11638]</title>
<updated>2018-03-07T14:28:31+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-07T14:28:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=072ef48c5bde371c096b76ce0db13b415312b408'/>
<id>072ef48c5bde371c096b76ce0db13b415312b408</id>
<content type='text'>
	Clarify the behavior of IO.write without offset in write mode.

	  https://github.com/ruby/ruby/pull/1571

	  Patch by @takanabe [fix GH-1571]
	  [Bug #11638][ruby-core:71277]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Clarify the behavior of IO.write without offset in write mode.

	  https://github.com/ruby/ruby/pull/1571

	  Patch by @takanabe [fix GH-1571]
	  [Bug #11638][ruby-core:71277]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 60055: [Backport #13856]</title>
<updated>2018-03-07T14:05:38+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-07T14:05:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=2921521e9215652e07af266b1870543f2e5b229c'/>
<id>2921521e9215652e07af266b1870543f2e5b229c</id>
<content type='text'>
	io.c: fix segfault with closing socket on Windows

	* io.c (fptr_finalize_flush): add an argument to keep GVL.
	* io.c (fptr_finalize): adjust for above change.
	* io.c (io_close_fptr): closing without GVL causes another
	  exception while raising exception in another thread. This causes
	  segfault on Windows. Keep GVL while closing when another thread
	  raises.
	  [Bug #13856] [ruby-core:82602]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: fix segfault with closing socket on Windows

	* io.c (fptr_finalize_flush): add an argument to keep GVL.
	* io.c (fptr_finalize): adjust for above change.
	* io.c (io_close_fptr): closing without GVL causes another
	  exception while raising exception in another thread. This causes
	  segfault on Windows. Keep GVL while closing when another thread
	  raises.
	  [Bug #13856] [ruby-core:82602]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 57944,57977,58062: [Backport #13306]</title>
<updated>2017-09-10T02:46:34+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-09-10T02:46:34+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=428687e96d9e58c13ebcbbfb4411f1edba71fcc5'/>
<id>428687e96d9e58c13ebcbbfb4411f1edba71fcc5</id>
<content type='text'>
	io.c: [DOC] IO#puts uses IO#write
	io.c: [DOC] add missing `$`
	io.c: [DOC] expand docs for IO#puts

	[ruby-core:80081] [Bug #13306]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: [DOC] IO#puts uses IO#write
	io.c: [DOC] add missing `$`
	io.c: [DOC] expand docs for IO#puts

	[ruby-core:80081] [Bug #13306]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 58008: [Backport #9294]</title>
<updated>2017-05-09T14:51:48+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-05-09T14:51:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=b2575bc8a228745a4668e2165b54a4627fb7055f'/>
<id>b2575bc8a228745a4668e2165b54a4627fb7055f</id>
<content type='text'>
	io.c: improve docs

	* io.c: [DOC] improve and harmonize docs for IO#read and ARGF#read;
	  fix invalid example code for IO#read to make it syntax highlighted.

	* io.c: [DOC] various improvements for docs of IO, ARGF, and Kernel:
	  fix indent to ensure correct code block detection; sync "outbuf"
	  paragraph for {IO,ARGF}#read, {IO,ARGF}#readpartial, and IO#sysread;
	  fix formatting of call-seq's; improve Kernel#open example to use nil?;
	  fix RDoc markup and typos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: improve docs

	* io.c: [DOC] improve and harmonize docs for IO#read and ARGF#read;
	  fix invalid example code for IO#read to make it syntax highlighted.

	* io.c: [DOC] various improvements for docs of IO, ARGF, and Kernel:
	  fix indent to ensure correct code block detection; sync "outbuf"
	  paragraph for {IO,ARGF}#read, {IO,ARGF}#readpartial, and IO#sysread;
	  fix formatting of call-seq's; improve Kernel#open example to use nil?;
	  fix RDoc markup and typos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 58534: [Backport #13533]</title>
<updated>2017-05-09T14:21:37+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-05-09T14:21:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=53b976efa0d49896341bcca0b17a636eb67bd54d'/>
<id>53b976efa0d49896341bcca0b17a636eb67bd54d</id>
<content type='text'>
	nogvl_wait_for_single_fd must wait as its name

	poll(fds, n, 0) mean no timeout and immediately return. If you want to
	wait something, you need to use -1 instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	nogvl_wait_for_single_fd must wait as its name

	poll(fds, n, 0) mean no timeout and immediately return. If you want to
	wait something, you need to use -1 instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@58622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 57767,57943: [Backport #10403]</title>
<updated>2017-03-12T18:41:38+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-03-12T18:41:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=94e70ce8697b03c9b4c947e47f235d65d86b251a'/>
<id>94e70ce8697b03c9b4c947e47f235d65d86b251a</id>
<content type='text'>
	io.c: documentation for puts

	* io.c: [DOC] clarify that the 'record separator' between
	  arguments passed to 'puts' is always a newline.
	  Based on a patch by Mark Amery. [ruby-core:65801] [Misc #10403]
	* 2017-03-13

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: documentation for puts

	* io.c: [DOC] clarify that the 'record separator' between
	  arguments passed to 'puts' is always a newline.
	  Based on a patch by Mark Amery. [ruby-core:65801] [Misc #10403]
	* 2017-03-13

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 57469,57471,57472,57503,57508: [Backport #13299]</title>
<updated>2017-03-12T18:15:33+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-03-12T18:15:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/ruby.git/commit/?id=baf330be0a49c4764bcff89335c4ce9ba2beee8d'/>
<id>baf330be0a49c4764bcff89335c4ce9ba2beee8d</id>
<content type='text'>
	io.c: recycle garbage on write

	* string.c (STR_IS_SHARED_M): new flag to mark shared mulitple times
	  (STR_SET_SHARED): set STR_IS_SHARED_M
	  (rb_str_tmp_frozen_acquire, rb_str_tmp_frozen_release): new functions
	  (str_new_frozen): set/unset STR_IS_SHARED_M as appropriate
	* internal.h: declare new functions
	* io.c (fwrite_arg, fwrite_do, fwrite_end): new
	  (io_fwrite): use new functions

	Introduce rb_str_tmp_frozen_acquire and rb_str_tmp_frozen_release
	to manage a hidden, frozen string.  Reuse one bit of the embed
	length for shared strings as STR_IS_SHARED_M to indicate a string
	has been shared multiple times.  In the common case, the string
	is only shared once so the object slot can be reclaimed immediately.

	minimum results in each 3 measurements. (time and size)

	Execution time (sec)
	name                            trunk   built
	io_copy_stream_write            0.682   0.254
	io_copy_stream_write_socket     1.225   0.751

	Speedup ratio: compare with the result of `trunk' (greater is better)
	name    built
	io_copy_stream_write            2.680
	io_copy_stream_write_socket     1.630

	Memory usage (last size) (B)
	name                            trunk           built
	io_copy_stream_write            95436800.000    6512640.000
	io_copy_stream_write_socket     117628928.000   7127040.000

	Memory consuming ratio (size) with the result of `trunk' (greater is better)
	name    built
	io_copy_stream_write            14.654
	io_copy_stream_write_socket     16.505
	string.c (rb_str_tmp_frozen_release): release embedded strings

	Handle the embedded case first, since we may have an embedded
	duplicate and non-embedded original string.

	* string.c (rb_str_tmp_frozen_release): handled embedded strings
	* test/ruby/test_io.rb (test_write_no_garbage): new test
	  [ruby-core:78898] [Bug #13085]
	io.c (rb_io_syswrite): avoid leaving garbage after write

	As with IO#write, IO#syswrite also generates garbage which can
	be harmful in hand-coded read-write loops.

	* io.c (swrite_arg, swrite_do, swrite_end): new
	  (rb_io_syswrite): use new functions to cleanup garbage
	  [ruby-core:78898] [Bug #13085]
	Add class name to assert messages
	io.c: remove rb_ensure usage for rb_str_tmp_frozen_* calls

	Using rb_ensure pessimizes the common case and makes the code
	more difficult to read and follow.  If we hit an exceptions
	during write, just let the GC handle cleanup as the exception
	is already bad for garbage.

	* io.c (io_fwrite): call rb_str_tmp_frozen{acquire,release} directly
	  (rb_io_syswrite): ditto
	  (fwrite_do, fwrite_end, swrite_do, swrite_end): remove

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	io.c: recycle garbage on write

	* string.c (STR_IS_SHARED_M): new flag to mark shared mulitple times
	  (STR_SET_SHARED): set STR_IS_SHARED_M
	  (rb_str_tmp_frozen_acquire, rb_str_tmp_frozen_release): new functions
	  (str_new_frozen): set/unset STR_IS_SHARED_M as appropriate
	* internal.h: declare new functions
	* io.c (fwrite_arg, fwrite_do, fwrite_end): new
	  (io_fwrite): use new functions

	Introduce rb_str_tmp_frozen_acquire and rb_str_tmp_frozen_release
	to manage a hidden, frozen string.  Reuse one bit of the embed
	length for shared strings as STR_IS_SHARED_M to indicate a string
	has been shared multiple times.  In the common case, the string
	is only shared once so the object slot can be reclaimed immediately.

	minimum results in each 3 measurements. (time and size)

	Execution time (sec)
	name                            trunk   built
	io_copy_stream_write            0.682   0.254
	io_copy_stream_write_socket     1.225   0.751

	Speedup ratio: compare with the result of `trunk' (greater is better)
	name    built
	io_copy_stream_write            2.680
	io_copy_stream_write_socket     1.630

	Memory usage (last size) (B)
	name                            trunk           built
	io_copy_stream_write            95436800.000    6512640.000
	io_copy_stream_write_socket     117628928.000   7127040.000

	Memory consuming ratio (size) with the result of `trunk' (greater is better)
	name    built
	io_copy_stream_write            14.654
	io_copy_stream_write_socket     16.505
	string.c (rb_str_tmp_frozen_release): release embedded strings

	Handle the embedded case first, since we may have an embedded
	duplicate and non-embedded original string.

	* string.c (rb_str_tmp_frozen_release): handled embedded strings
	* test/ruby/test_io.rb (test_write_no_garbage): new test
	  [ruby-core:78898] [Bug #13085]
	io.c (rb_io_syswrite): avoid leaving garbage after write

	As with IO#write, IO#syswrite also generates garbage which can
	be harmful in hand-coded read-write loops.

	* io.c (swrite_arg, swrite_do, swrite_end): new
	  (rb_io_syswrite): use new functions to cleanup garbage
	  [ruby-core:78898] [Bug #13085]
	Add class name to assert messages
	io.c: remove rb_ensure usage for rb_str_tmp_frozen_* calls

	Using rb_ensure pessimizes the common case and makes the code
	more difficult to read and follow.  If we hit an exceptions
	during write, just let the GC handle cleanup as the exception
	is already bad for garbage.

	* io.c (io_fwrite): call rb_str_tmp_frozen{acquire,release} directly
	  (rb_io_syswrite): ditto
	  (fwrite_do, fwrite_end, swrite_do, swrite_end): remove

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@57941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
