Adrian Lienhard wrote:
On Dec 8, 2009, at 12:08 , Mariano Martinez Peck wrote:
On Fri, Dec 4, 2009 at 12:05 PM, Adrian Lienhard <adi@netstyle.ch> wrote:
When you are creating your root of objects and you put symbols inside, they are not put in ourPointers but in ByteArray. This is due to the fact that the only object who is pointing to that symbol is inside the segment ?
To be precise, the symbols are also pointed to by the symbol table, but only by weak references. Since image segments use the GC mark logic, these pointers are not considered.
Martin and I had been working towards the idea that ImageSegments should never create non-Canonical symbols, and the user should not have to use manual techniques to preserve symbols they are interested in keeping alive. I ended up getting stuck however, in trying to discover what process ImageSegment goes through while it is installing objects - ImageSegment #install has a call to an unimplemented method #readFromFileWithSymbols which it seems it should be using, but isn't....(wha' the?) install "This operation retrieves the segment if necessary from file storage, installs it in memory, and replaces (using become:) all the root stubs with the reconstructed roots of the segment." | newRoots | state = #onFile ifTrue: [self readFromFile]. state = #onFileWithSymbols ifTrue: [self readFromFileWithSymbols. endMarker := segment nextObject. "for enumeration of objects" endMarker == 0 ifTrue: [endMarker := 'End' clone]]. (state = #active) | (state = #imported) ifFalse: [self errorWrongState]. newRoots := self loadSegmentFrom: segment outPointers: outPointers. state = #imported ifTrue: ["just came in from exported file" arrayOfRoots := newRoots] ifFalse: [ arrayOfRoots elementsForwardIdentityTo: newRoots]. state := #inactive. Beeper beepPrimitive I think the next step in this trajectory is to trace is how the state is getting set - right now it is kind of a mystery... Does this seem reasonable? Thanks, Sheri -- View this message in context: http://n2.nabble.com/Re-getting-rid-of-Symbol-new-tp4109230p4143090.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.