<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018, 4:32 AM Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" rel="noreferrer noreferrer" target="_blank">simonpj@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_-5750861915700000731m_6899194368669386108m_-6754760951712491041WordSection1">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:36.0pt">
That's explained in the paper. A StableName# is a pointer to a stable name object in the heap that *contains* an index into the stable name table. Basically, the garbage collector needs to know whether a stable name is alive or not, so it can work out when
to clear it from the table.</p>
<p class="MsoNormal">Very good. But could it be explained in a Note too? The paper is from a long time ago, contains lots of surrounding explanation, and might well be out of date (even if it in fact is not out of date).</p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Certainly there should be a note, but as I mentioned in this thread, I think we can probably actually do better than we presently do.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div class="m_-5750861915700000731m_6899194368669386108m_-6754760951712491041WordSection1"><p class="MsoNormal"></p>
<p class="MsoNormal"><br></p>
<p class="MsoNormal">So the entry in the table /also/ points to the same, heap-allocated StableName#? Doesn’t that keep it alive? Or is this akin to the treatment of weak pointers? (Which is part of the same paper.)</p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">The stable name table is not in the root set. All its references are weak.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div class="m_-5750861915700000731m_6899194368669386108m_-6754760951712491041WordSection1"><p class="MsoNormal"></p>
<p class="MsoNormal"><br></p>
<p class="MsoNormal">Do we anywhere keep a pointer to the object that this is a stable name of?</p></div></div></blockquote></div></div><div dir="auto">Yes. That's in the stable name table entry. It's also the key for the stable name hash table.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div class="m_-5750861915700000731m_6899194368669386108m_-6754760951712491041WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><div><div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div></div></div>