[squeak-dev] The Trunk: System-cwp.660.mcz

Eliot Miranda eliot.miranda at gmail.com
Fri Jan 10 22:32:03 UTC 2014


On Thu, Jan 9, 2014 at 6:06 AM, Colin Putney <colin at wiresong.com> wrote:

>
>
>
> On Thu, Jan 9, 2014 at 2:01 AM, Levente Uzonyi <leves at elte.hu> wrote:
>
>
>> Btw, this won't work, because this expression is evaluated as
>>
>>         ((lastObject == object) | object) == 0
>>
>> which should raise an error, because most objects don't understand #|.
>> Also, I prefer the lazy #or: over #|, because it's faster.
>
>
> You're right, it's a bug, but it does work, accidentally. It ends up going
> like this:
>
> 1. lastObject == object -> aBoolean
> 2. aBoolean | object -> true or object
> 3a. true == 0 -> false
> 3b. object == 0 -> true or false
>
> For all objects except the sentinel object, we end up at 3b, and since
> #nextObject answers 0 when the receiver is the last object in the heap, we
> end up with the correct semantics.
>
> However, it defeats the purpose of the sentinel object, which is to avoid
> an infinite loop caused by new block contexts being allocated when the
> block is executed. The reason I needed this change in the first place is
> that I was getting an error because SmallInteger shouldn't implement
> #nextObject. So somehow we were getting to the end of the heap without
> encountering the sentinel.
>
> So I have two questions:
>
> 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...


> 2) Why don't we get an infinite loop when we don't check for the sentinel?
>
> Colin
>
>
>
>


-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140110/83f9f53a/attachment.htm


More information about the Squeak-dev mailing list