[squeak-dev] Help with ImageSegments
Adrian Lienhard
adi at netstyle.ch
Sat May 2 12:05:24 UTC 2009
The class SMSqueakMap uses image segments. You may find this useful as
a starting point.
Image segments are much faster than reference streams, but you need to
take care that there are no references pointing from the outside into
the graph of objects you are saving (except for globally used objects
like symbols). Else, these and all other indirectly referenced objects
end up in a reference stream that in the segment.
Cheers,
Adrian
On May 2, 2009, at 10:22 , Herbert König wrote:
> Hello Brent,
>
> BP> Thanks,
> BP> Interestingly there is not mention in this example of
> BP> ImageSegment or SmartRefStream.
> BP> Are these classes abandoned ?
>
> somewhere in the past I had a problem with using SmartRefStream and
> it worked with ReferenceStream, so I abandoned SmartRefStream.
>
> And Bert is right, ReferenceStream doesn't use ImageSegment.
>
> If in my examples you just replace ReferenceStream with SmartRefStream
> the writing still works but the reading doesn't.
>
> Searching the archives I got it working by:
>
> readTrainingsSamples
> "read the class var TrainingsSamples from a file using
> ReferenceStreams "
> | rr |
> rr := StandardFileStream fileNamed: 'trainingssamples.obj'.
> TrainingsSamplesFehlerkategorien trainingsSamples: rr
> fileInObjectAndCode.
> rr close.
> rr := nil
>
>
>
> Cheers
>
> Herbert mailto:herbertkoenig at gmx.net
>
>
More information about the Squeak-dev
mailing list
|