<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/io_buffer.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) 35e124832e29b65c84d4e0e4e434616859f9bdf5: [Backport #20755]</title>
<updated>2024-11-04T22:39:22+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-04T22:39:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5ce0ba0d415deb99527c409cc5f1df16ce02ef3e'/>
<id>5ce0ba0d415deb99527c409cc5f1df16ce02ef3e</id>
<content type='text'>
	[Bug #20755] Frozen string should not be writable via IO::Buffer
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20755] Frozen string should not be writable via IO::Buffer
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) 637067440f74043c6d79fc649ab8acf1afea25a5: [Backport #20752]</title>
<updated>2024-11-04T22:38:18+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-11-04T22:38:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12ea98e8c8af0ed6778aad26e7ec5f95e2c239e5'/>
<id>12ea98e8c8af0ed6778aad26e7ec5f95e2c239e5</id>
<content type='text'>
	[Bug #20752] Slice of readonly `IO::Buffer` also should be readonly
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #20752] Slice of readonly `IO::Buffer` also should be readonly
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) c5cf4d4e129f64cb69aaf0a829aed068ef1943c4: [Backport#19542] (#9829)</title>
<updated>2024-02-04T13:54:36+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>nurse@users.noreply.github.com</email>
</author>
<published>2024-02-04T13:54:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d7dc57a545d75c01313a9020b162ebb648a3ea18'/>
<id>d7dc57a545d75c01313a9020b162ebb648a3ea18</id>
<content type='text'>
merge revision(s) c5cf4d4e129f64cb69aaf0a829aed068ef1943c4: [Backport #19542]

	Improve behavioural consistency of unallocated (zero length)
	 `IO::Buffer`. (#9532)

	This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent.

	Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805.
	---
	 io_buffer.c                 | 14 ++++++--------
	 test/ruby/test_io_buffer.rb | 35 +++++++++++++++++++++++++++++++++++
	 2 files changed, 41 insertions(+), 8 deletions(-)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
merge revision(s) c5cf4d4e129f64cb69aaf0a829aed068ef1943c4: [Backport #19542]

	Improve behavioural consistency of unallocated (zero length)
	 `IO::Buffer`. (#9532)

	This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent.

	Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805.
	---
	 io_buffer.c                 | 14 ++++++--------
	 test/ruby/test_io_buffer.rb | 35 +++++++++++++++++++++++++++++++++++
	 2 files changed, 41 insertions(+), 8 deletions(-)</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) e5a4f757bdf5dc3d8c329ddd268432f9ecc7bff6: [Backport #20086]</title>
<updated>2024-01-30T01:24:31+00:00</updated>
<author>
<name>NARUSE, Yui</name>
<email>naruse@airemix.jp</email>
</author>
<published>2024-01-30T01:24:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=818b4ea9b16e3570b431b86da9a24a5743b29617'/>
<id>818b4ea9b16e3570b431b86da9a24a5743b29617</id>
<content type='text'>
	Fix Window private file mapping unlink EACCES issue. (#9358)

	* Don't return early.

	* Add missing `mapping` assignment.

	* Make debug logs conditional.
	---
	 io_buffer.c                 | 18 ++++++++++++------
	 test/ruby/test_io_buffer.rb | 32 ++++++++++++++------------------
	 2 files changed, 26 insertions(+), 24 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix Window private file mapping unlink EACCES issue. (#9358)

	* Don't return early.

	* Add missing `mapping` assignment.

	* Make debug logs conditional.
	---
	 io_buffer.c                 | 18 ++++++++++++------
	 test/ruby/test_io_buffer.rb | 32 ++++++++++++++------------------
	 2 files changed, 26 insertions(+), 24 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>Correctly release the underlying file mapping. (#9340)</title>
<updated>2023-12-25T01:20:53+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-12-25T01:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=260bf60e52ffdfa625be1153624b0d123fc305f8'/>
<id>260bf60e52ffdfa625be1153624b0d123fc305f8</id>
<content type='text'>
* Avoiding using `Tempfile` which was retaining the file preventing it from unlinking.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Avoiding using `Tempfile` which was retaining the file preventing it from unlinking.</pre>
</div>
</content>
</entry>
<entry>
<title>IO::Buffer improvements and documentation. (#9329)</title>
<updated>2023-12-24T13:03:36+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2023-12-24T13:03:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=37753f163e461e157e6e224d9d3e5626427a50cc'/>
<id>37753f163e461e157e6e224d9d3e5626427a50cc</id>
<content type='text'>
* Restore experimental warnings.

* Documentation and code structure improvements.

* Improved validation of flags, clarified documentation of argument handling.

* Remove inconsistent use of `Example:` and add example to `null?`.

* Expose `IO::Buffer#private?` and add test.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Restore experimental warnings.

* Documentation and code structure improvements.

* Improved validation of flags, clarified documentation of argument handling.

* Remove inconsistent use of `Example:` and add example to `null?`.

* Expose `IO::Buffer#private?` and add test.</pre>
</div>
</content>
</entry>
<entry>
<title>Implement IO::Buffer on VWA</title>
<updated>2023-12-19T14:13:20+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-14T19:15:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8e6f63df47089361f7988176bb22ed3c96ecf95a'/>
<id>8e6f63df47089361f7988176bb22ed3c96ecf95a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Add document of IO::Buffer#hexdump</title>
<updated>2023-12-18T11:17:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-18T10:51:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=835f1461f7d34941c8163650eb94965533eba029'/>
<id>835f1461f7d34941c8163650eb94965533eba029</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement Write Barriers on IO::Buffer</title>
<updated>2023-12-14T17:22:38+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-13T19:09:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c5e3d6da9cc7199128218711b89df45c8bf7c6f1'/>
<id>c5e3d6da9cc7199128218711b89df45c8bf7c6f1</id>
<content type='text'>
Benchmark:

```
require "benchmark"

puts(Benchmark.measure do
  ary = 1_000_000.times.map { IO::Buffer.for("") }

  10.times { GC.start(full_mark: false) }
end)
```

Before:

```
14.330119   0.051497  14.381616 ( 14.445106)
```

After:

```
7.481152   0.040166   7.521318 (  7.535209)
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Benchmark:

```
require "benchmark"

puts(Benchmark.measure do
  ary = 1_000_000.times.map { IO::Buffer.for("") }

  10.times { GC.start(full_mark: false) }
end)
```

Before:

```
14.330119   0.051497  14.381616 ( 14.445106)
```

After:

```
7.481152   0.040166   7.521318 (  7.535209)
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Use xfree for IO::Buffer</title>
<updated>2023-12-12T23:47:58+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2023-12-11T18:23:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2350c7946275cd570cc1d7cd892abc16ac68a92c'/>
<id>2350c7946275cd570cc1d7cd892abc16ac68a92c</id>
<content type='text'>
Since IO::Buffer is allocated using TypedData_Make_Struct, it must use
xfree to free the buffer otherwise it will cause more major GC to run.

Example:

```
10.times do
  1_000_000.times { IO::Buffer.new(0) }

  puts "oldmalloc_increase_bytes: #{GC.stat(:oldmalloc_increase_bytes)}, major_gc_count: #{GC.stat(:major_gc_count)}"
end
```

Before:

```
oldmalloc_increase_bytes: 14904176, major_gc_count: 3
oldmalloc_increase_bytes: 2399424, major_gc_count: 5
oldmalloc_increase_bytes: 5204640, major_gc_count: 6
oldmalloc_increase_bytes: 2199936, major_gc_count: 7
oldmalloc_increase_bytes: 34199936, major_gc_count: 7
oldmalloc_increase_bytes: 24223360, major_gc_count: 8
oldmalloc_increase_bytes: 5967616, major_gc_count: 9
oldmalloc_increase_bytes: 37967616, major_gc_count: 9
oldmalloc_increase_bytes: 9689792, major_gc_count: 10
oldmalloc_increase_bytes: 41689792, major_gc_count: 10
```

After:

```
oldmalloc_increase_bytes: 117392, major_gc_count: 2
oldmalloc_increase_bytes: 26128, major_gc_count: 2
oldmalloc_increase_bytes: 71600, major_gc_count: 2
oldmalloc_increase_bytes: 117072, major_gc_count: 2
oldmalloc_increase_bytes: 17296, major_gc_count: 2
oldmalloc_increase_bytes: 62768, major_gc_count: 2
oldmalloc_increase_bytes: 108240, major_gc_count: 2
oldmalloc_increase_bytes: 153712, major_gc_count: 2
oldmalloc_increase_bytes: 53936, major_gc_count: 2
oldmalloc_increase_bytes: 99408, major_gc_count: 2
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since IO::Buffer is allocated using TypedData_Make_Struct, it must use
xfree to free the buffer otherwise it will cause more major GC to run.

Example:

```
10.times do
  1_000_000.times { IO::Buffer.new(0) }

  puts "oldmalloc_increase_bytes: #{GC.stat(:oldmalloc_increase_bytes)}, major_gc_count: #{GC.stat(:major_gc_count)}"
end
```

Before:

```
oldmalloc_increase_bytes: 14904176, major_gc_count: 3
oldmalloc_increase_bytes: 2399424, major_gc_count: 5
oldmalloc_increase_bytes: 5204640, major_gc_count: 6
oldmalloc_increase_bytes: 2199936, major_gc_count: 7
oldmalloc_increase_bytes: 34199936, major_gc_count: 7
oldmalloc_increase_bytes: 24223360, major_gc_count: 8
oldmalloc_increase_bytes: 5967616, major_gc_count: 9
oldmalloc_increase_bytes: 37967616, major_gc_count: 9
oldmalloc_increase_bytes: 9689792, major_gc_count: 10
oldmalloc_increase_bytes: 41689792, major_gc_count: 10
```

After:

```
oldmalloc_increase_bytes: 117392, major_gc_count: 2
oldmalloc_increase_bytes: 26128, major_gc_count: 2
oldmalloc_increase_bytes: 71600, major_gc_count: 2
oldmalloc_increase_bytes: 117072, major_gc_count: 2
oldmalloc_increase_bytes: 17296, major_gc_count: 2
oldmalloc_increase_bytes: 62768, major_gc_count: 2
oldmalloc_increase_bytes: 108240, major_gc_count: 2
oldmalloc_increase_bytes: 153712, major_gc_count: 2
oldmalloc_increase_bytes: 53936, major_gc_count: 2
oldmalloc_increase_bytes: 99408, major_gc_count: 2
```
</pre>
</div>
</content>
</entry>
</feed>
