#rehash in ImageSegment

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

#rehash in ImageSegment

Avi  Bryant
--
restoreEndianness
        "Fix endianness (byte order) of any objects not already fixed.  Do
this by discovering classes that need a startUp message sent to each
instance, and sending it.
        I have just been brought in and converted to live objects.  Find all
Sets and Dictionaries in the newly created objects and rehash them.
--

Can anyone explain to me why we need to rehash all sets when loading
in an ImageSegment?  The #identityHash of objects is preserved, and
presumably any other #hash function will also be ok.  The fact that
this happens in #restoreEndianness makes me think that maybe the
#identityHash changes if you move a segment between architectures, but
I haven't tested that.  At any rate it seems odd to do it
unconditionally, since this often seems to be a major percentage of
the load time for an image segment.

Avi

Reply | Threaded
Open this post in threaded view
|

Re: #rehash in ImageSegment

Andreas.Raab
Avi Bryant wrote:
> Can anyone explain to me why we need to rehash all sets when loading
> in an ImageSegment?  The #identityHash of objects is preserved, and
> presumably any other #hash function will also be ok.  The fact that
> this happens in #restoreEndianness makes me think that maybe the
> #identityHash changes if you move a segment between architectures, but
> I haven't tested that.  At any rate it seems odd to do it
> unconditionally, since this often seems to be a major percentage of
> the load time for an image segment.

It is necessary since the ImageSegment can refer to objects in the image
(via its outPointers) whose hashes _are_ different. Most importantly
symbols.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Re: #rehash in ImageSegment

Avi  Bryant
On 11/22/06, Andreas Raab <[hidden email]> wrote:

> It is necessary since the ImageSegment can refer to objects in the image
> (via its outPointers) whose hashes _are_ different. Most importantly
> symbols.

Ah, of course.  Thanks.

Avi