<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 10.05.2012, at 19:22, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Thu, May 10, 2012 at 10:16 AM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt;&gt; I should add, it's already happened. &nbsp;In 2009 Levente changed<br>
&gt;&gt; Object&gt;&gt;#identityHash to answer the scaledIdentityHash.<br>
&gt;<br>
&gt; Not in Squeak. Our IdentityDictionary uses scaledIdentityHash nowadays, but identityHash itself is left alone, answering the primitive value directly.<br>
<br>
I meant to say Object&gt;&gt;#hash, not #identityHash.<br>
<br>
So, before 12/1/2009:<br>
<br>
 &nbsp; &nbsp; true hash &nbsp;"2950"<br>
<br>
but after 12/1/2009<br>
<br>
 &nbsp; &nbsp; true hash &nbsp;"773324800"<br>
<br>
So, any saved persistent EToys ReferenceStream object-models files<br>
with true involved in the calculation of #hash prior to 2009 will now<br>
be goofed up unless you remember to rehash all regular Dictionary's<br>
after loading it. &nbsp;The properties of this bug are:<br>
<br>
 &nbsp;- it is hidden, you had no idea it was there because no SUnit test<br>
can possibly catch it. &nbsp;It didn't show until production.<br>
 &nbsp;- it is image-specific -- you load the file an image before<br>
Levente's change and everything seems fine. &nbsp;What's going on?<br>
 &nbsp;- it is "intermittent" because there's a small possibility that, if<br>
the Dictionary were small, you might get lucky with a "hit" anyway<br>
when calculating the slot to start searching at<br>
 &nbsp;- it could lead to corrupt data model, because perhaps the app does<br>
something like #at:ifAbsentPut:, and maybe even on an<br>
otherwise-equivalent object, so you end up with TWO of the "same"<br>
object in the dictionary. &nbsp;What a disaster!<br>
<br>
Now does it make sense?<br></blockquote><div><br></div><div>No. &nbsp;One *always* has to rehash on loading binary since one cannot guarantee that identityHashes will be the same in the loading environment as the saving environment. &nbsp;It s a non-issue.&nbsp;</div>
</div><br>-- <br>best,<div>Eliot</div></blockquote></div><div><br></div><div>Yep. See e.g. ImageSegment&gt;&gt;restoreEndianness (which does a bit more than the name suggests).</div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div></span></div><br></body></html>