<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/array.c, branch v3_0_4</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) fb4cf204a662a8cd9dafef6f31f2bd0db9129abe,fa0279d947c3962c3f8c32852278d3ebb964cb19: [Backport #17725]</title>
<updated>2021-12-24T08:47:44+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-12-24T08:47:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=545d6820715a48a17d6182128c0db4198dfa76c1'/>
<id>545d6820715a48a17d6182128c0db4198dfa76c1</id>
<content type='text'>
	use me-&gt;def instead of me for opt_table

	`vm_opt_method_table` is me=&gt;bop table to manage the optimized
	methods (by specialized instruction). However, `me` can be invalidated
	to invalidate the method cache entry.
	[Bug #17725]

	To solve the issue, use `me-def` instead of `me` which simply copied
	at invalidation timing.

	A test by @jeremyevans https://github.com/ruby/ruby/pull/4376
	---
	 test/ruby/test_method.rb | 15 +++++++++++++++
	 vm.c                     | 11 +++++------
	 2 files changed, 20 insertions(+), 6 deletions(-)

	should not share same `def` for specialized method

	Because the key of redefine table is `def`, `def` should be
	unique for each optimized method (`alias` is not allowed).
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	use me-&gt;def instead of me for opt_table

	`vm_opt_method_table` is me=&gt;bop table to manage the optimized
	methods (by specialized instruction). However, `me` can be invalidated
	to invalidate the method cache entry.
	[Bug #17725]

	To solve the issue, use `me-def` instead of `me` which simply copied
	at invalidation timing.

	A test by @jeremyevans https://github.com/ruby/ruby/pull/4376
	---
	 test/ruby/test_method.rb | 15 +++++++++++++++
	 vm.c                     | 11 +++++------
	 2 files changed, 20 insertions(+), 6 deletions(-)

	should not share same `def` for specialized method

	Because the key of redefine table is `def`, `def` should be
	unique for each optimized method (`alias` is not allowed).
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) cd4f5b13228879d954fa97b6aa479c4a5ef4fb0a,8db269edb3550a85dfab9b193ea115ca36912ced,ab63f6d8543903f177c46634f38e5428655f003b: [Backport #18140]</title>
<updated>2021-09-05T03:19:53+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-09-05T03:19:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=92846db6861eed324288819157e6c7722fc62fc2'/>
<id>92846db6861eed324288819157e6c7722fc62fc2</id>
<content type='text'>
	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	[ruby-core:105099] [Bug #18140]
	---
	 array.c                 | 1 +
	 test/ruby/test_array.rb | 6 ++++++
	 2 files changed, 7 insertions(+)

	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	Thanks @jhaberman for the test case

	[ruby-core:105099] [Bug #18140]
	---
	 ext/-test-/array/concat/depend          | 321 ++++++++++++++++++++++++++++++++
	 ext/-test-/array/concat/extconf.rb      |   2 +
	 ext/-test-/array/concat/to_ary_conact.c |  64 +++++++
	 test/-ext-/array/test_to_ary_concat.rb  |  20 ++
	 4 files changed, 407 insertions(+)
	 create mode 100644 ext/-test-/array/concat/depend
	 create mode 100644 ext/-test-/array/concat/extconf.rb
	 create mode 100644 ext/-test-/array/concat/to_ary_conact.c
	 create mode 100644 test/-ext-/array/test_to_ary_concat.rb

	Refined test [Bug #18140]

	---
	 ext/-test-/array/concat/to_ary_conact.c | 48 +++++++--------------------------
	 test/ruby/test_array.rb                 |  5 +++-
	 2 files changed, 13 insertions(+), 40 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	[ruby-core:105099] [Bug #18140]
	---
	 array.c                 | 1 +
	 test/ruby/test_array.rb | 6 ++++++
	 2 files changed, 7 insertions(+)

	Guard array when appending

	This prevents early collection of the array.  The GC doesn't see the
	array on the stack when Ruby is compiled with optimizations enabled

	Thanks @jhaberman for the test case

	[ruby-core:105099] [Bug #18140]
	---
	 ext/-test-/array/concat/depend          | 321 ++++++++++++++++++++++++++++++++
	 ext/-test-/array/concat/extconf.rb      |   2 +
	 ext/-test-/array/concat/to_ary_conact.c |  64 +++++++
	 test/-ext-/array/test_to_ary_concat.rb  |  20 ++
	 4 files changed, 407 insertions(+)
	 create mode 100644 ext/-test-/array/concat/depend
	 create mode 100644 ext/-test-/array/concat/extconf.rb
	 create mode 100644 ext/-test-/array/concat/to_ary_conact.c
	 create mode 100644 test/-ext-/array/test_to_ary_concat.rb

	Refined test [Bug #18140]

	---
	 ext/-test-/array/concat/to_ary_conact.c | 48 +++++++--------------------------
	 test/ruby/test_array.rb                 |  5 +++-
	 2 files changed, 13 insertions(+), 40 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) d43279edacd09edf3a43e02d62f5be475e7c3bcb,5dc36ddcd00fc556c04c15ce9770c5a84d7d43dc,523bf31564f160f899f8cf9f73540d6a6f687f17: [Backport #18138]</title>
<updated>2021-08-29T10:09:35+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-08-29T10:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8899fa0b3d41fd27dd1a2c6f75106cb78ff27236'/>
<id>8899fa0b3d41fd27dd1a2c6f75106cb78ff27236</id>
<content type='text'>
	Fix length calculation for Array#slice!

	Commit 4f24255 introduced a bug which allows a length to be passed to
	rb_ary_new4 which is too large, resulting in invalid memory access.

	For example:

	    (1..1000).to_a.slice!(-2, 1000)
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Add out of range tests for Array#slice!

	---
	 test/ruby/test_array.rb | 13 +++++++++++++
	 1 file changed, 13 insertions(+)

	Add negative position tests [Bug #18138]

	---
	 test/ruby/test_array.rb | 4 ++++
	 1 file changed, 4 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Fix length calculation for Array#slice!

	Commit 4f24255 introduced a bug which allows a length to be passed to
	rb_ary_new4 which is too large, resulting in invalid memory access.

	For example:

	    (1..1000).to_a.slice!(-2, 1000)
	---
	 array.c | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Add out of range tests for Array#slice!

	---
	 test/ruby/test_array.rb | 13 +++++++++++++
	 1 file changed, 13 insertions(+)

	Add negative position tests [Bug #18138]

	---
	 test/ruby/test_array.rb | 4 ++++
	 1 file changed, 4 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) e019dd24df4ed7063ad80d4c2e4070141793f598,7954bb056be30e86c419fe3792064d28990a4999,7d3fdfb27dac456827b004d9e66a44b15f8cd762: [Backport #17736]</title>
<updated>2021-05-23T06:51:10+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2021-05-23T06:51:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=44b87adc07621b6a8eddfcf4aaff34ce634179d4'/>
<id>44b87adc07621b6a8eddfcf4aaff34ce634179d4</id>
<content type='text'>
	Ensure the receiver is modifiable before shrinking [Bug #17736]

	* Ensure the receiver is modifiable before shinking [Bug #17736]

	* Assert the receivers are not modified
	---
	 array.c                 |  1 +
	 test/ruby/test_array.rb | 36 ++++++++++++++++++++++++++++++++++++
	 2 files changed, 37 insertions(+)

	Some Hash destructive methods ensure the receiver modifiable [Bug
	 #17736]

	refs:

	* https://bugs.ruby-lang.org/issues/17736
	* https://github.com/ruby/ruby/pull/4296

	This commit aims to cover following methods

	* Hash#select!
	* Hash#filter!
	* Hash#keep_if
	* Hash#reject!
	* Hash#delete_if

	I think these are not all.

	---

	* Ensure the receiver is modifiable or not
	* Assert the receiver is not modified
	---
	 hash.c                 |  2 ++
	 test/ruby/test_hash.rb | 42 ++++++++++++++++++++++++++++++++++++++++++
	 2 files changed, 44 insertions(+)

	Hash#transform_values! ensures receiver modifiable in block [Bug
	 #17736]

	---
	 hash.c                 | 1 +
	 test/ruby/test_hash.rb | 9 +++++++++
	 2 files changed, 10 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	Ensure the receiver is modifiable before shrinking [Bug #17736]

	* Ensure the receiver is modifiable before shinking [Bug #17736]

	* Assert the receivers are not modified
	---
	 array.c                 |  1 +
	 test/ruby/test_array.rb | 36 ++++++++++++++++++++++++++++++++++++
	 2 files changed, 37 insertions(+)

	Some Hash destructive methods ensure the receiver modifiable [Bug
	 #17736]

	refs:

	* https://bugs.ruby-lang.org/issues/17736
	* https://github.com/ruby/ruby/pull/4296

	This commit aims to cover following methods

	* Hash#select!
	* Hash#filter!
	* Hash#keep_if
	* Hash#reject!
	* Hash#delete_if

	I think these are not all.

	---

	* Ensure the receiver is modifiable or not
	* Assert the receiver is not modified
	---
	 hash.c                 |  2 ++
	 test/ruby/test_hash.rb | 42 ++++++++++++++++++++++++++++++++++++++++++
	 2 files changed, 44 insertions(+)

	Hash#transform_values! ensures receiver modifiable in block [Bug
	 #17736]

	---
	 hash.c                 | 1 +
	 test/ruby/test_hash.rb | 9 +++++++++
	 2 files changed, 10 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>Document usage of ArithmeticSequence in Array#slice, and add to NEWS (#3952)</title>
<updated>2020-12-21T00:32:30+00:00</updated>
<author>
<name>Victor Shepelev</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2020-12-21T00:32:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5253b9579a129f66a768dae24bd50a95bab02841'/>
<id>5253b9579a129f66a768dae24bd50a95bab02841</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use category: :deprecated in warnings that are related to deprecation</title>
<updated>2020-12-18T17:54:11+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-09-28T17:10:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=05313c914b29f7027b27a91021ae2662f0149e54'/>
<id>05313c914b29f7027b27a91021ae2662f0149e54</id>
<content type='text'>
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
</pre>
</div>
</content>
</entry>
<entry>
<title>tuning trial: newobj with current ec</title>
<updated>2020-12-06T23:28:36+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-12-06T06:41:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=344ec26a99e09c2d2f756fa6384e75ffa48f415f'/>
<id>344ec26a99e09c2d2f756fa6384e75ffa48f415f</id>
<content type='text'>
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
</pre>
</div>
</content>
</entry>
<entry>
<title>should not use rb_ary_modify()</title>
<updated>2020-12-01T04:18:32+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2020-12-01T02:14:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8247b8eddeb2a504a5c9776d1f77d413c8146897'/>
<id>8247b8eddeb2a504a5c9776d1f77d413c8146897</id>
<content type='text'>
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]

A test is quoted from https://github.com/ruby/ruby/pull/3817
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]

A test is quoted from https://github.com/ruby/ruby/pull/3817
</pre>
</div>
</content>
</entry>
<entry>
<title>Removed canonicalization for mathn</title>
<updated>2020-11-10T02:14:15+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-10-23T05:38:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b958e2add835d62c0a62edaf9a23ecbbd70a3635'/>
<id>b958e2add835d62c0a62edaf9a23ecbbd70a3635</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix  links</title>
<updated>2020-11-10T02:04:00+00:00</updated>
<author>
<name>S-H-GAMELINKS</name>
<email>gamelinks007@gmail.com</email>
</author>
<published>2020-11-05T16:50:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8b3653b484a1130987c6b774c71e69a4a64a4f27'/>
<id>8b3653b484a1130987c6b774c71e69a4a64a4f27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
