<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/gc.c, branch v4.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) c0d86a0103de7130943d54b4a290b76ec7e0c135,47e061277ac194a36659510bcf4f3190bde629a6: [Backport #21952]</title>
<updated>2026-05-11T20:54:55+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2026-05-11T20:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8539f0b386e2e42f8fe5ac12a2fd9e84872d8c7c'/>
<id>8539f0b386e2e42f8fe5ac12a2fd9e84872d8c7c</id>
<content type='text'>
	class.c: rb_class_duplicate_classext also dup content of cvc_tbl

	[Bug #21952]

	Shallow copying the table result in the same memory being shared
	between multiple box, causing double free when one of the box
	is garbage collected.

	---

	class.c: Make cvc_tbl a managed object

	[Bug #21952]

	Solves the double-free or use after-free concern with boxes.
	Now entries can safely be used for copy-on-write.

	Also is likely necessary to make it save to read cvar from
	secondary ractors, as allowed since: ab32c0e690b805cdaaf264ad4c3421696c588204
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	class.c: rb_class_duplicate_classext also dup content of cvc_tbl

	[Bug #21952]

	Shallow copying the table result in the same memory being shared
	between multiple box, causing double free when one of the box
	is garbage collected.

	---

	class.c: Make cvc_tbl a managed object

	[Bug #21952]

	Solves the double-free or use after-free concern with boxes.
	Now entries can safely be used for copy-on-write.

	Also is likely necessary to make it save to read cvar from
	secondary ractors, as allowed since: ab32c0e690b805cdaaf264ad4c3421696c588204
</pre>
</div>
</content>
</entry>
<entry>
<title>Simplify subclasses list, remove from Box</title>
<updated>2026-03-20T00:57:58+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2026-03-10T19:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b22593ac12d0e8cbcf8299f0fea14c6311715d8'/>
<id>2b22593ac12d0e8cbcf8299f0fea14c6311715d8</id>
<content type='text'>
Currently we maintain the subclasses list for two separate purposes (we essentially have to different relationships we're putting into the same list):

1. On a T_MODULE, we track the T_ICLASSes created to include it into
   other classes. Used for method invalidation and propagating includes
   on the module that happen after it's been used
2. On a T_CLASS/T_ICLASS, we track the T_CLASS/T_ICLASS which are the
   immediate children of the class. We use this for method invalidation,
   some cvar things, and to iterate through subclasses.

Purpose 1 does not have any issues with box, the T_ICLASS always belongs
to one specific module and that's immutable. This list can be box-global
(always use the prime classext or hoist it out) and only needs to be
pruned during free. If we care about behaviour under a particular box
(ie. the propagating includes), we should look up the current box being
modified on the ICLASS itself.

Purpose 2 is more complicated. It currently tracks the immediate
children, the T_CLASS or T_ICLASS whose super points back. Because super
is per-box and is mutable (include/prepend insert ICLASSes into the
chain) we need to update the list on include/prepend, entries must be
per-box, and we can have multiple entries per-box. *I propose we
simplify this by no longer tracking the immediate subclass*, but instead
tracking the T_CLASS -&gt; ... -&gt; T_CLASS relationship, ie. the inverse of
rb_class_superclass. That relationship is the same across all boxes and
immutable after Class creation.

As a special case the ICLASS for refinements are also added to the
purpose 2 list (on T_CLASS). As those ICLASS do not chain to an eventual
leaf T_CLASS.

When we need to find the classes which have included a module, we can
use the module subclasses list to find the ICLASS and then use
RCLASS_INCLUDER. If we needed to iterate all T_ICLASS, we could then
walk up the CLASS_SUPER chain, but I didn't find anywhere we needed to
do that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we maintain the subclasses list for two separate purposes (we essentially have to different relationships we're putting into the same list):

1. On a T_MODULE, we track the T_ICLASSes created to include it into
   other classes. Used for method invalidation and propagating includes
   on the module that happen after it's been used
2. On a T_CLASS/T_ICLASS, we track the T_CLASS/T_ICLASS which are the
   immediate children of the class. We use this for method invalidation,
   some cvar things, and to iterate through subclasses.

Purpose 1 does not have any issues with box, the T_ICLASS always belongs
to one specific module and that's immutable. This list can be box-global
(always use the prime classext or hoist it out) and only needs to be
pruned during free. If we care about behaviour under a particular box
(ie. the propagating includes), we should look up the current box being
modified on the ICLASS itself.

Purpose 2 is more complicated. It currently tracks the immediate
children, the T_CLASS or T_ICLASS whose super points back. Because super
is per-box and is mutable (include/prepend insert ICLASSes into the
chain) we need to update the list on include/prepend, entries must be
per-box, and we can have multiple entries per-box. *I propose we
simplify this by no longer tracking the immediate subclass*, but instead
tracking the T_CLASS -&gt; ... -&gt; T_CLASS relationship, ie. the inverse of
rb_class_superclass. That relationship is the same across all boxes and
immutable after Class creation.

As a special case the ICLASS for refinements are also added to the
purpose 2 list (on T_CLASS). As those ICLASS do not chain to an eventual
leaf T_CLASS.

When we need to find the classes which have included a module, we can
use the module subclasses list to find the ICLASS and then use
RCLASS_INCLUDER. If we needed to iterate all T_ICLASS, we could then
walk up the CLASS_SUPER chain, but I didn't find anywhere we needed to
do that.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move special const check to gc.c for rb_gc_impl_object_moved_p</title>
<updated>2025-12-23T18:54:08+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-12-23T17:59:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e2cf92eddc5403316b0d449b02ba403a27610d7b'/>
<id>e2cf92eddc5403316b0d449b02ba403a27610d7b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Check slot_size before zeroing memory for GC hook</title>
<updated>2025-12-20T16:27:34+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-12-20T13:40:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fe9a7448b131a48ee37df720fbbfae3142d274ca'/>
<id>fe9a7448b131a48ee37df720fbbfae3142d274ca</id>
<content type='text'>
If the slot_size &lt; RVALUE_SIZE then we would underflow in the memset.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the slot_size &lt; RVALUE_SIZE then we would underflow in the memset.
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Small changes to docs for ObjectSpace#each_object (#15564)</title>
<updated>2025-12-17T19:00:58+00:00</updated>
<author>
<name>Luke Gruber</name>
<email>luke.gruber@shopify.com</email>
</author>
<published>2025-12-17T19:00:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=601ac78caf1523170b2f88767d67ffa5e8c5b1bc'/>
<id>601ac78caf1523170b2f88767d67ffa5e8c5b1bc</id>
<content type='text'>
Change example to use user-defined class instead of `Numeric`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change example to use user-defined class instead of `Numeric`.</pre>
</div>
</content>
</entry>
<entry>
<title>Rename to `struct rbimpl_size_overflow_tag`</title>
<updated>2025-12-17T08:35:58+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-12-17T05:28:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=61bab1889048f758396acf671c9797d6bc52504b'/>
<id>61bab1889048f758396acf671c9797d6bc52504b</id>
<content type='text'>
This struct is used for addition not only for multiplication, so
remove the word `mul`, and make the member names more descriptive.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This struct is used for addition not only for multiplication, so
remove the word `mul`, and make the member names more descriptive.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add assumption to free_vm_weak_references</title>
<updated>2025-12-11T17:53:18+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-12-06T10:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=89e09e4daf1b27c94dbf326c8f5b0b5f864a6e72'/>
<id>89e09e4daf1b27c94dbf326c8f5b0b5f864a6e72</id>
<content type='text'>
Help the compiler know that we always get a heap object here.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Help the compiler know that we always get a heap object here.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add `NUM2PTR` and `PTR2NUM` macros</title>
<updated>2025-12-10T03:09:50+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-12-10T03:09:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3636277dc5837bcedcd5ef43d49423194064a676'/>
<id>3636277dc5837bcedcd5ef43d49423194064a676</id>
<content type='text'>
These macros have been defined here and there, so collect them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These macros have been defined here and there, so collect them.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix typos in gc.c and gc.rb</title>
<updated>2025-12-09T07:45:38+00:00</updated>
<author>
<name>hi</name>
<email>hi@localhost</email>
</author>
<published>2025-12-05T14:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=25f277abe481b9109d59d28a2eee3f9998a9ad3a'/>
<id>25f277abe481b9109d59d28a2eee3f9998a9ad3a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Output ivar length for T_OBJECT in obj_info</title>
<updated>2025-12-07T16:51:02+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2025-12-07T15:24:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4f900c35bc01e12b948703b9e4b4f5d0e803f073'/>
<id>4f900c35bc01e12b948703b9e4b4f5d0e803f073</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
