[squeak-dev] Constantly growing Image file

Eliot Miranda eliot.miranda at gmail.com
Thu Dec 29 18:40:57 UTC 2022



> On Dec 29, 2022, at 5:17 AM, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
> 
> 
> Hi Eliot,
> 
> 
> 
> > ifNotNil: is inlined.  It is equivalent to this, but saves the temp decl, which is why it's so nice.
> 
> > 
> > | obj |
> > obj := TheClass someInstance.
> > obj == nil ifFalse: [obj chasePointers]
> 
> Why won't #chasePointers pick up the obj tempvar from the snippet above? Is this just because contexts are only married on demand?

IIRC it’s because chasePointers explicitly excludes its sender context.
 
> 
> Best,
> Christoph
> 
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Eliot Miranda <eliot.miranda at gmail.com>
> Gesendet: Donnerstag, 29. Dezember 2022 04:21 Uhr
> An: Chris Muller
> Cc: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Constantly growing Image file
>  
> Hi Chris,
> 
>> On Tue, Dec 27, 2022 at 11:50 AM Chris Muller <ma.chris.m at gmail.com> wrote:
>>>>> If the latter is the case, it would be a Heisentool, where the attempt of using it changes that which it is supposed to observe. :-P
>>>> 
>>>> Which is why I don't use the pointer explorer when I'm trying to clean all instance of a class out.  Instead:
>>>> 
>>>>     TheClass allInstances anyOne chasePointers
>>> 
>>> TheClass someInstance ifNotNil: [:obj| obj chasePointers]
>> 
>> Ah, I will start using #someInstance, but typing ifNotNil: is a lot more work than closing a debugger when no more instances.  Besides, wouldn't the Block Context's var, "obj" be another possible reference that #chasePointers might pick up on?
> 
> ifNotNil: is inlined.  It is equivalent to this, but saves the temp decl, which is why it's so nice.
> 
> | obj |
> obj := TheClass someInstance.
> obj == nil ifFalse: [obj chasePointers]
> 
> _,,,^..^,,,_
> best, Eliot
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20221229/4121cf26/attachment.html>


More information about the Squeak-dev mailing list