On 10 January 2011 10:51, Mariano Martinez Peck <
marianopeck@gmail.com> wrote:
> Hi. I was almost sure that Set instances� that were written in an
> ImageSegment,� needed to be rehashed once they are swap in. And I even
> thought I was understanding why. But now, I don't understand at all why is
> that. I would really appreciate anyway that can give me a hint.
>
> So...ImageSegment rehashes all Set instances (at loading time) that were
> written in an ImageSegment, and then exported with ReferenceStream. Notice
> that this rehash is finally called from ImageSegment >> comeFullyUpOnReload:
> smartRefStream.
> When you export an ImageSegment with a reference stream, you also serializer
> the "outPointers" array. This is usually the case when you want to load the
> object subgraph in another image or when do it backups so that to start with
> a clean image.� Notice that the Set rehash only occurs in this case. If we
> use ImageSegment just to swap out / in, there is no Set rehash.
> So...I think that this has something to do about WHY Set instances need to
> be rehashed.
>
> For each object ImageSegment write into the file, it writes both: object
> header + slots.�� So....the hash (12 bits in the object header) is copied.
> When the object is loaded back, it continues to have the same hash. It
> doesn't change.
> So...if hash doesn't change, why Set instances need to be rehashes when they
> come back from an ImageSegment?
>
> Thanks in advance,
>
> Mariano
>