cyclic looping with [0 == object] whileFalse: [object := objectnextObject].

John M McIntosh johnmci at
Mon Nov 5 19:18:06 UTC 2007

On Nov 5, 2007, at 10:44 AM, Rob Withers wrote:

> I thought of a possibility.  It could be that I am creating objects  
> (BlockContexts and MethodContexts) as fast as I process them in  
> this loop. If the loop is creating objects, then they are bound to  
> be at the end of memory and I am bound to not be able to catch up  
> to them.  In this case, my #ifTrue: msg is a real msg creating a  
> real BlockContext each time through the loop, because of my  
> Compiler changes, and the associated MethodContexts are being  
> created too.  (My addition of anOrderedCollection>>#add:/#addLast:/ 
> #grow... are being recorded as well). Each time through a new  
> instance of the BlockContext is being created.
> That sucks.  I can't do anything about it.

As an optimization methodContexts are recycled and reused, this  
feature decreases the time take
to make a new context. When a method returns the local context is  
then stuffed onto the free context chain.
However on a GC the free context chain is GCed also. So usually you  
are not making a new object (MethodContexts ) for the message  

John M. McIntosh <johnmci at>
Corporate Smalltalk Consulting Ltd.

More information about the Squeak-dev mailing list