[squeak-dev] Re: Using #= for integer comparison instead of #==

Bert Freudenberg bert at freudenbergs.de
Fri Nov 26 17:12:50 UTC 2010


On 26.11.2010, at 18:09, Andres Valloud wrote:

> Can you assume that allocation is sequential?

I can.

- Bert -

> On 11/26/10 8:59 , Bert Freudenberg wrote:
>> 
>> On 26.11.2010, at 17:43, Andres Valloud wrote:
>> 
>>>> You *must* use an end marker, i.e.,
>>>> 
>>>> 	last := Object new. "end marker"
>>>> 	obj := self someObject.
>>>> 	[last == obj] whileFalse:[
>>>> 		count := count + 1.
>>>> 		obj := obj nextObject.
>>>> 	].
>>>> 
>>>> This will work because it counts between the beginning of memory and the
>>>> (arbitrary) end marker. Anything else basically should not be relied on
>>>> to work, jit or no.
>>> 
>>> What happens if a process with higher priority interrupts the iteration and creates more objects?
>> 
>> New objects would come after the end marker in memory.
>> 
>> - Bert -




More information about the Squeak-dev mailing list