https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112019-05-13T22:42:27ZRuby Issue Tracking SystemRuby master - Feature #15833: Some refactors for shared-root arrayhttps://redmine.ruby-lang.org/issues/15833?journal_id=779952019-05-13T22:42:27ZEregon (Benoit Daloze)
<ul></ul><p>I think nowadays RArray should be considered internal and C extensions should not access members of struct RArray directly, as that's very likely going to be incorrect or very complex.<br>
I don't think many C extensions use RArray directly, but it would be good to check.</p> Ruby master - Feature #15833: Some refactors for shared-root arrayhttps://redmine.ruby-lang.org/issues/15833?journal_id=779992019-05-14T00:08:14Zwanabe (_ wanabe)s.wanabe@gmail.com
<ul></ul><p>Eregon (Benoit Daloze) wrote:</p>
<blockquote>
<p>I think nowadays RArray should be considered internal and C extensions should not access members of struct RArray directly, as that's very likely going to be incorrect or very complex.<br>
I don't think many C extensions use RArray directly, but it would be good to check.</p>
</blockquote>
<p>Thank you to comment.<br>
I didn't think about C extension but the readability of MRI itself.<br>
<code>struct RArray</code> definition can't move from <code>include/ruby/ruby.h</code>, so it can't be avoided to modify <code>include/ruby/ruby.h</code> if I want to rename <code>struct RArray</code> member for readability.</p>
<p>But I change my mind that it may not be good to export <code>RARRAY_SHARED_ROOT_FLAG</code>.<br>
I will drop <code>0002-Export-RARRAY_SHARED_ROOT_FLAG.patch</code>.<br>
And I will also drop <code>0003-Fix-object-info-of-shared-root-array.patch</code> because it it based on above 0002.</p> Ruby master - Feature #15833: Some refactors for shared-root arrayhttps://redmine.ruby-lang.org/issues/15833?journal_id=780322019-05-15T21:05:50ZEregon (Benoit Daloze)
<ul></ul><p>I think RARRAY_SHARED_ROOT_FLAG could be in internal.h, if you want to expose it outside of array.c but not as public C API.</p>
<p>Longer-term I think we should move struct RArray to internal.h, but that's a much bigger/riskier change so not for this issue obviously :)</p> Ruby master - Feature #15833: Some refactors for shared-root arrayhttps://redmine.ruby-lang.org/issues/15833?journal_id=801642019-07-29T07:13:25Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Eregon (Benoit Daloze) wrote:</p>
<blockquote>
<p>I think RARRAY_SHARED_ROOT_FLAG could be in internal.h, if you want to expose it outside of array.c but not as public C API.</p>
<p>Longer-term I think we should move struct RArray to internal.h, but that's a much bigger/riskier change so not for this issue obviously :)</p>
</blockquote>
<p>I agree both.</p>