<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 10:16 AM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>> I should add, it's already happened. In 2009 Levente changed<br>
>> Object>>#identityHash to answer the scaledIdentityHash.<br>
><br>
> 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>>#hash, not #identityHash.<br>
<br>
So, before 12/1/2009:<br>
<br>
true hash "2950"<br>
<br>
but after 12/1/2009<br>
<br>
true hash "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. The properties of this bug are:<br>
<br>
- it is hidden, you had no idea it was there because no SUnit test<br>
can possibly catch it. It didn't show until production.<br>
- it is image-specific -- you load the file an image before<br>
Levente's change and everything seems fine. What's going on?<br>
- 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>
- 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. What a disaster!<br>
<br>
Now does it make sense?<br></blockquote><div><br></div><div>No. 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. It s a non-issue. </div>
</div><br>-- <br>best,<div>Eliot</div><br>