[squeak-dev] The Trunk: System-cwp.660.mcz
Levente Uzonyi
leves at elte.hu
Sat Jan 11 08:13:38 UTC 2014
On Sat, 11 Jan 2014, Levente Uzonyi wrote:
> On Fri, 10 Jan 2014, Colin Putney wrote:
>
>>
>>
>>
>> On Fri, Jan 10, 2014 at 5:32 PM, Eliot Miranda <eliot.miranda at gmail.com>
>> wrote:
>>
>> 1) Why isn't the sentinel object enumerated in a shrunken image?
>>
>> send me an image poised at the right point and I'll take a look...
>>
>>
>> While working on creating this image, I noticed that Bert was right. There
>> is a #becomeForward: happening inside the block that's passed into
>> #allObjectsDo:. It's because #allObjectsDo: is called from
>> #obsoleteBehaviors, which sends #isBehavior to all the objects. If the
>> image happens to contain an instance of MCInfoProxy, the DNU causes it to
>> download the full ancestry and become it.
>>
>> However, I don't see why that would cause the sentinel object not to be
>> enumerated.
>
> Because #nextObject will be sent to an object which was created after the
> sentinel.
Now I see why it wasn't clear. For performance reasons #become* methods
don't move the objects around, they just rewrite the pointers pointing to
them. Here's an example:
a := { $a }.
b := { $b }.
c := { $c }.
self assert: a nextObject == b.
self assert: b nextObject == c.
b become: c.
self assert: a nextObject = #($b).
self assert: b = #($c).
self assert: c = #($b).
self assert: a nextObject == c.
self assert: c nextObject == b.
I think it might help in this case, to ask for the next object before
evaluating the block in the loop of #allObjectsDo:
[lastObject == object]
whileFalse: [
| nextObject |
nextObject := object nextObject.
aBlock value: object.
object := nextObject]
Levente
>
>
> Levente
>
>>
>> Colin
>>
>
More information about the Squeak-dev
mailing list
|