[squeak-dev] Re: [Pharo-project] start-up and shut-down lists
Eliot Miranda
eliot.miranda at gmail.com
Fri Jul 13 21:18:17 UTC 2012
On Fri, Jul 13, 2012 at 12:22 PM, Marcus Denker <marcus.denker at inria.fr>wrote:
>
> On Jul 13, 2012, at 9:09 PM, Eliot Miranda wrote:
>
> > Hi All,
> >
> > I'm profiling image startup and consequently want to pause a
> MessageTally during a snapshot. So I want to add MessageTally to the
> StartUpList immediately after Delay (the first entry in StartUpList) and to
> the ShutDownList immediately before Delay. But when I look at the
> SmalltalkImage accessor I see some confusion:
> >
>
> In Pharo I have rewritting this: you can add either before or after, so
> there is support for both adding before and after:
>
Thanks, Marcus. Much simpler too.
>
>
> add: aClass toList: startUpOrShutDownList after: predecessor
> "Add the name of aClass to the startUp or shutDown list.
> Add it after the name of predecessor"
>
> (Smalltalk globals includes: aClass)
> ifFalse: [self error: aClass name , ' cannot be found in
> Smalltalk dictionary.'].
>
> "Add after predecessor, moving it if already there."
> (Smalltalk globals includes: predecessor)
> ifFalse: [self error: predecessor name , ' cannot be found
> in Smalltalk dictionary.'].
> (startUpOrShutDownList includes: predecessor name)
> ifFalse: [self error: predecessor name , ' cannot be found
> in the list.'].
> startUpOrShutDownList remove: aClass name ifAbsent:[].
> startUpOrShutDownList add: aClass name after: predecessor name
>
>
> add: aClass toList: startUpOrShutDownList before: successor
> "Add the name of aClass to the startUp or shutDown list.
> Add it before the name of successor"
>
> (Smalltalk globals includes: aClass)
> ifFalse: [self error: aClass name , ' cannot be found in
> Smalltalk dictionary.'].
>
> "Add before successor, moving it if already there."
> (Smalltalk globals includes: successor)
> ifFalse: [self error: successor name , ' cannot be found
> in Smalltalk dictionary.'].
> (startUpOrShutDownList includes: successor name)
> ifFalse: [self error: successor name , ' cannot be found
> in the list.'].
> startUpOrShutDownList remove: aClass name ifAbsent: [].
> startUpOrShutDownList add: aClass name before: successor name.
>
>
>
>
>
> --
> Marcus Denker -- http://marcusdenker.de
>
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120713/66ffdbf6/attachment.htm
More information about the Squeak-dev
mailing list
|