<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/method.h, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Make tracepoints with set_trace_func or TracePoint.new ractor local (#15468)</title>
<updated>2025-12-16T19:06:55+00:00</updated>
<author>
<name>Luke Gruber</name>
<email>luke.gruber@shopify.com</email>
</author>
<published>2025-12-16T19:06:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4fb537b1ee28bb37dbe551ac65c279d436c756bc'/>
<id>4fb537b1ee28bb37dbe551ac65c279d436c756bc</id>
<content type='text'>
Before this change, GC'ing any Ractor object caused you to lose all
enabled tracepoints across all ractors (even main). Now tracepoints are
ractor-local and this doesn't happen. Internal events are still global.

Fixes [Bug #19112]</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this change, GC'ing any Ractor object caused you to lose all
enabled tracepoints across all ractors (even main). Now tracepoints are
ractor-local and this doesn't happen. Internal events are still global.

Fixes [Bug #19112]</pre>
</div>
</content>
</entry>
<entry>
<title>Change bmethod defined_ractor to use id instead</title>
<updated>2025-12-04T21:25:45+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-10-30T19:05:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1d3fe2c382fd543bf12b2e12c2633162ea4b3a0a'/>
<id>1d3fe2c382fd543bf12b2e12c2633162ea4b3a0a</id>
<content type='text'>
When defining a bmethod, we recorded the current Ractor's object in the
method. However that was never marked and so could be GC'd and reused by
a future Ractor. Instead we can use the Ractor's id, which we expect to
be unique forever.

Co-authored-by: Luke Gruber &lt;luke.gru@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When defining a bmethod, we recorded the current Ractor's object in the
method. However that was never marked and so could be GC'd and reused by
a future Ractor. Instead we can use the Ractor's id, which we expect to
be unique forever.

Co-authored-by: Luke Gruber &lt;luke.gru@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>renaming internal data structures and functions from namespace to box</title>
<updated>2025-11-07T04:14:54+00:00</updated>
<author>
<name>Satoshi Tagomori</name>
<email>s-tagomori@sakura.ad.jp</email>
</author>
<published>2025-11-05T07:09:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d2a587c79156275f66035d60bcc69882be61a3e1'/>
<id>d2a587c79156275f66035d60bcc69882be61a3e1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Only set ME cached flag when unset</title>
<updated>2025-09-23T17:20:21+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-08-21T00:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c05ea920cef5991ca6163d12a436a61219a234a6'/>
<id>c05ea920cef5991ca6163d12a436a61219a234a6</id>
<content type='text'>
The same method entry may be reused in multiple caches, so once the
CACHED flag is set, other Ractors may be checking for it being
invalidated and we should avoid writing to the field again.

I believe there are still other race conditions on how we manipulate
these flags (particularly the invalidation bit), but this should make
them less frequent.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The same method entry may be reused in multiple caches, so once the
CACHED flag is set, other Ractors may be checking for it being
invalidated and we should avoid writing to the field again.

I believe there are still other race conditions on how we manipulate
these flags (particularly the invalidation bit), but this should make
them less frequent.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make `RClass.cc_table` a managed object</title>
<updated>2025-08-01T08:42:04+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2025-07-30T10:44:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f2a7e48deadb9101d49c9b613abf5a83c9e1dd49'/>
<id>f2a7e48deadb9101d49c9b613abf5a83c9e1dd49</id>
<content type='text'>
For now this doesn't change anything, but now that the table
is managed by GC, it opens the door to use RCU when in multi-ractor
mode, hence allow unsynchornized reads.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For now this doesn't change anything, but now that the table
is managed by GC, it opens the door to use RCU when in multi-ractor
mode, hence allow unsynchornized reads.
</pre>
</div>
</content>
</entry>
<entry>
<title>Optimize callcache invalidation for refinements</title>
<updated>2025-06-09T03:33:35+00:00</updated>
<author>
<name>alpaca-tc</name>
<email>alpaca-tc@alpaca.tc</email>
</author>
<published>2025-04-05T16:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c8ddc0a843074811b200673a2019fbe4b50bb890'/>
<id>c8ddc0a843074811b200673a2019fbe4b50bb890</id>
<content type='text'>
Fixes [Bug #21201]

This change addresses a performance regression where defining methods
inside `refine` blocks caused severe slowdowns. The issue was due to
`rb_clear_all_refinement_method_cache()` triggering a full object
space scan via `rb_objspace_each_objects` to find and invalidate
affected callcaches, which is very inefficient.

To fix this, I introduce `vm-&gt;cc_refinement_table` to track
callcaches related to refinements. This allows us to invalidate
only the necessary callcaches without scanning the entire heap,
resulting in significant performance improvement.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #21201]

This change addresses a performance regression where defining methods
inside `refine` blocks caused severe slowdowns. The issue was due to
`rb_clear_all_refinement_method_cache()` triggering a full object
space scan via `rb_objspace_each_objects` to find and invalidate
affected callcaches, which is very inefficient.

To fix this, I introduce `vm-&gt;cc_refinement_table` to track
callcaches related to refinements. This allows us to invalidate
only the necessary callcaches without scanning the entire heap,
resulting in significant performance improvement.
</pre>
</div>
</content>
</entry>
<entry>
<title>namespace on read</title>
<updated>2025-05-11T14:32:50+00:00</updated>
<author>
<name>Satoshi Tagomori</name>
<email>tagomoris@gmail.com</email>
</author>
<published>2025-04-30T04:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=382645d440d5da66a0c04557f3ff2ca226de3a27'/>
<id>382645d440d5da66a0c04557f3ff2ca226de3a27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Use atomic for method reference count [Bug #20934]</title>
<updated>2025-03-20T20:09:40+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2025-03-18T22:02:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bfe6068417ca41a6b88a1ba5fcde04f9a76718a7'/>
<id>bfe6068417ca41a6b88a1ba5fcde04f9a76718a7</id>
<content type='text'>
This changes reference_count on rb_method_definition_struct into an
atomic.

Ractors can create additional references as part of `bind_call` or
(presumably) similar. Because this can be done inside Ractors, we should
use a lock or atomics so that we don't race and avoid incrementing.

Co-authored-by: wanabe &lt;s.wanabe@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes reference_count on rb_method_definition_struct into an
atomic.

Ractors can create additional references as part of `bind_call` or
(presumably) similar. Because this can be done inside Ractors, we should
use a lock or atomics so that we don't race and avoid incrementing.

Co-authored-by: wanabe &lt;s.wanabe@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Place all non-default GC API behind USE_SHARED_GC</title>
<updated>2024-11-25T13:05:23+00:00</updated>
<author>
<name>Matt Valentine-House</name>
<email>matt@eightbitraptor.com</email>
</author>
<published>2024-11-22T13:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=551be8219e8a4c5b0021716b047976d66feb3048'/>
<id>551be8219e8a4c5b0021716b047976d66feb3048</id>
<content type='text'>
So that it doesn't get included in the generated binaries for builds
that don't support loading shared GC modules

Co-Authored-By: Peter Zhu &lt;peter@peterzhu.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that it doesn't get included in the generated binaries for builds
that don't support loading shared GC modules

Co-Authored-By: Peter Zhu &lt;peter@peterzhu.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip a redundant check for the rb_obj_hash case</title>
<updated>2024-03-01T23:02:28+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2024-03-01T23:01:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=61fbd29e14c0bd06ca4c063ff34332b272874a13'/>
<id>61fbd29e14c0bd06ca4c063ff34332b272874a13</id>
<content type='text'>
Also, refactor the cfunc struct to use a new rb_cfunc_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, refactor the cfunc struct to use a new rb_cfunc_t.
</pre>
</div>
</content>
</entry>
</feed>
