<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_class.rb, branch v3_2_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) 72d1a790cfe0e4a457db98c587f1acaa5e39f001: [Backport #19833]</title>
<updated>2023-08-12T04:51:03+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2023-08-12T04:51:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b11f238a811513b31c4f65c822370ac470f438dc'/>
<id>b11f238a811513b31c4f65c822370ac470f438dc</id>
<content type='text'>
	[Bug #19833] Fix index underflow at superclasses of `BasicObject`

	---
	 object.c                | 4 ++++
	 test/ruby/test_class.rb | 7 +++++++
	 2 files changed, 11 insertions(+)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[Bug #19833] Fix index underflow at superclasses of `BasicObject`

	---
	 object.c                | 4 ++++
	 test/ruby/test_class.rb | 7 +++++++
	 2 files changed, 11 insertions(+)
</pre>
</div>
</content>
</entry>
<entry>
<title>Module#remove_method: Check frozen on the right object</title>
<updated>2022-12-01T22:32:41+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2022-12-01T22:32:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3d272b0fc822f5c2e9c716377b7fcecf15426b27'/>
<id>3d272b0fc822f5c2e9c716377b7fcecf15426b27</id>
<content type='text'>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#attached_object</title>
<updated>2022-10-20T15:30:17+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk@paralaus.com</email>
</author>
<published>2022-09-26T22:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0378e2f4a8319440dd65c82b16f189161472d237'/>
<id>0378e2f4a8319440dd65c82b16f189161472d237</id>
<content type='text'>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove Class#descendants</title>
<updated>2021-12-20T19:02:15+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-12-20T16:26:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3bd5f27f737c7d365b7d01c43d77a958c224ab16'/>
<id>3bd5f27f737c7d365b7d01c43d77a958c224ab16</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>TestClass#test_subclass_gc reduce the number of iteration by 10x</title>
<updated>2021-12-03T11:27:29+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-12-03T09:17:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=324d57df0b28982590609d7ae080f82074a82a5c'/>
<id>324d57df0b28982590609d7ae080f82074a82a5c</id>
<content type='text'>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#subclasses</title>
<updated>2021-11-23T09:50:44+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-10-28T12:07:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c0c2b31a35e19a47b499b57807bc0a0f9325f6d3'/>
<id>c0c2b31a35e19a47b499b57807bc0a0f9325f6d3</id>
<content type='text'>
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix a memory leak introduced in 8bbd319</title>
<updated>2021-11-11T13:54:48+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2021-11-10T22:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c53aecee3bec524b91d7f2534291802a1cabb3f5'/>
<id>c53aecee3bec524b91d7f2534291802a1cabb3f5</id>
<content type='text'>
This commit fixes a memory leak introduced in an early part of the
variable width allocation project that would prevent the rb_classext_t
struct from being free'd when the class is swept.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes a memory leak introduced in an early part of the
variable width allocation project that would prevent the rb_classext_t
struct from being free'd when the class is swept.
</pre>
</div>
</content>
</entry>
<entry>
<title>class.c: descendants must not cause GC until the result array is created</title>
<updated>2021-11-10T01:08:30+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2021-11-09T08:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5c892da7d7974aeed8e7dd97bb31d2394cc19356'/>
<id>5c892da7d7974aeed8e7dd97bb31d2394cc19356</id>
<content type='text'>
Follow up of 428227472fc6563046d8138aab17f07bef6af753. The previous fix
uses `rb_ary_new_from_values` to create the result array, but it may
trigger the GC.

This second try is to create the result array by `rb_ary_new_capa`
before the second iteration, and assume that `rb_ary_push` does not
trigger GC. This assumption is very fragile, so should be improved in
future.

[Bug #18282] [Feature #14394]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up of 428227472fc6563046d8138aab17f07bef6af753. The previous fix
uses `rb_ary_new_from_values` to create the result array, but it may
trigger the GC.

This second try is to create the result array by `rb_ary_new_capa`
before the second iteration, and assume that `rb_ary_push` does not
trigger GC. This assumption is very fragile, so should be improved in
future.

[Bug #18282] [Feature #14394]
</pre>
</div>
</content>
</entry>
<entry>
<title>class.c: calculate the length of Class.descendants in advance</title>
<updated>2021-11-09T07:11:10+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2021-11-02T10:23:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=428227472fc6563046d8138aab17f07bef6af753'/>
<id>428227472fc6563046d8138aab17f07bef6af753</id>
<content type='text'>
GC must not be triggered during callback of rb_class_foreach_subclass.
To prevent GC, we can not use rb_ary_push. Instead, this changeset calls
rb_class_foreach_subclass twice: first counts the subclasses, then
allocates a buffer (which may cause GC and reduce subclasses, but not
increase), and finally stores the subclasses to the buffer.

[Bug #18282] [Feature #14394]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GC must not be triggered during callback of rb_class_foreach_subclass.
To prevent GC, we can not use rb_ary_push. Instead, this changeset calls
rb_class_foreach_subclass twice: first counts the subclasses, then
allocates a buffer (which may cause GC and reduce subclasses, but not
increase), and finally stores the subclasses to the buffer.

[Bug #18282] [Feature #14394]
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#descendants</title>
<updated>2021-10-26T19:35:21+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-10-26T19:35:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=717ab0bb2ee63dfe76076e0c9f91fbac3a0de4fd'/>
<id>717ab0bb2ee63dfe76076e0c9f91fbac3a0de4fd</id>
<content type='text'>
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima &lt;fatkodima123@gmail.com&gt;
Co-authored-by: Benoit Daloze &lt;eregontp@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima &lt;fatkodima123@gmail.com&gt;
Co-authored-by: Benoit Daloze &lt;eregontp@gmail.com&gt;</pre>
</div>
</content>
</entry>
</feed>
