https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112016-05-23T08:08:36ZRuby Issue Tracking SystemRuby master - Feature #12416: struct rb_id_table lacks mark functionhttps://redmine.ruby-lang.org/issues/12416?journal_id=588182016-05-23T08:08:36Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p><a href="mailto:shyouhei@ruby-lang.org" class="email">shyouhei@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>Bug <a class="issue tracker-2 status-1 priority-4 priority-default" title="Feature: struct rb_id_table lacks mark function (Open)" href="https://redmine.ruby-lang.org/issues/12416">#12416</a>: struct rb_id_table lacks mark function<br>
<a href="https://bugs.ruby-lang.org/issues/12416" class="external">https://bugs.ruby-lang.org/issues/12416</a></p>
</blockquote>
<blockquote>
<p>The struct rb_id_table can hold arbitrary VALUE values.</p>
</blockquote>
<p>Can, but currently does not (AFAIK).</p>
<blockquote>
<p>Now that this<br>
struct is reachable form Ruby's object space, it must understand what GC<br>
requests to it.</p>
</blockquote>
<p>Do you have plans to hold arbitrary VALUE objects?</p>
<blockquote>
<p>+++ b/iseq.c<br>
@@ -128,6 +128,7 @@ rb_iseq_mark(const rb_iseq_t *iseq)<br>
RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);<br>
RUBY_MARK_UNLESS_NULL(compile_data->err_info);<br>
RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary);</p>
<ul>
<li>rb_id_table_mark(compile_data->ivar_cache_table);</li>
</ul>
</blockquote>
<p>Right now, ivar_cache_table only holds Fixnum which does<br>
not need marking. Even with generational GC, I still prefer<br>
we not waste CPU cycles walking through tables for noops.</p> Ruby master - Feature #12416: struct rb_id_table lacks mark functionhttps://redmine.ruby-lang.org/issues/12416?journal_id=588192016-05-23T10:32:00Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>On 05/23/2016 05:07 PM, Eric Wong wrote:</p>
<blockquote>
<p>Do you have plans to hold arbitrary VALUE objects?</p>
</blockquote>
<p>Yes. I plan to post a feature request with a patch, that has a<br>
hunk to store an array into an rb_id_table.</p>
<blockquote>
<blockquote>
<p>+++ b/iseq.c<br>
@@ -128,6 +128,7 @@ rb_iseq_mark(const rb_iseq_t *iseq)<br>
RUBY_MARK_UNLESS_NULL(compile_data->mark_ary);<br>
RUBY_MARK_UNLESS_NULL(compile_data->err_info);<br>
RUBY_MARK_UNLESS_NULL(compile_data->catch_table_ary);</p>
<ul>
<li>rb_id_table_mark(compile_data->ivar_cache_table);</li>
</ul>
</blockquote>
<p>Right now, ivar_cache_table only holds Fixnum which does<br>
not need marking. Even with generational GC, I still prefer<br>
we not waste CPU cycles walking through tables for noops.</p>
</blockquote>
<p>OK then, I give up this iseq.c hunk.</p>
<p>Given the ability for this struct to hold GC-managed objects, I<br>
guess it is only a matter of time if someone actually do. People<br>
can use id tables that way now already with a custom mark<br>
function. I think it is a good idea to provide a default one for<br>
them, even if it has no actual usage today.</p> Ruby master - Feature #12416: struct rb_id_table lacks mark functionhttps://redmine.ruby-lang.org/issues/12416?journal_id=876292020-09-22T19:43:04Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li><li><strong>ruby -v</strong> deleted (<del><i>ruby 2.4.0dev (2016-05-23) [x86_64-linux]</i></del>)</li><li><strong>Backport</strong> deleted (<del><i>2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN</i></del>)</li></ul>