[squeak-dev] Re: [Pharo-project] start-up and shut-down lists

Marcus Denker marcus.denker at inria.fr
Fri Jul 13 19:22:25 UTC 2012


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:


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



More information about the Squeak-dev mailing list