[squeak-dev] The Trunk: EToys-ar.64.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Mar 6 04:52:58 UTC 2010


Andreas Raab uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ar.64.mcz

==================== Summary ====================

Name: EToys-ar.64
Author: ar
Time: 5 March 2010, 8:52:07.771 pm
UUID: fe9e267f-c264-0940-b6e8-03b45697d008
Ancestors: EToys-ar.63

Avoid dictionary protocol in Smalltalk.

=============== Diff against EToys-ar.63 ===============

Item was changed:
  ----- Method: EToySystem classSide>>cleanupsForRelease (in category 'development support') -----
  cleanupsForRelease
  	"Miscellaneous space cleanups to do before a release."
  	"EToySystem cleanupsForRelease"
  
  	Socket deadServer: ''.  "Don't reveal any specific server name"
  	HandMorph initialize.  "free cached ColorChart"
  	PaintBoxMorph initialize.	"forces Prototype to let go of extra things it might hold"
+ 	Smalltalk globals removeKey: #AA ifAbsent: [].
+ 	Smalltalk globals removeKey: #BB ifAbsent: [].
+ 	Smalltalk globals removeKey: #CC ifAbsent: [].
+ 	Smalltalk globals removeKey: #DD ifAbsent: [].
+ 	Smalltalk globals removeKey: #Temp ifAbsent: [].
- 	Smalltalk removeKey: #AA ifAbsent: [].
- 	Smalltalk removeKey: #BB ifAbsent: [].
- 	Smalltalk removeKey: #CC ifAbsent: [].
- 	Smalltalk removeKey: #DD ifAbsent: [].
- 	Smalltalk removeKey: #Temp ifAbsent: [].
  
  	ScriptingSystem reclaimSpace.
  	Smalltalk cleanOutUndeclared.
  	Smalltalk reclaimDependents.
  	Smalltalk forgetDoIts.
  	Smalltalk removeEmptyMessageCategories.
  	Symbol rehash.
  !

Item was changed:
  ----- Method: Player classSide>>freeUnreferencedSubclasses (in category 'housekeeping') -----
  freeUnreferencedSubclasses
  	"Player classes may hold in their class instance variables references
  to instances of themselves that are housekeepingwise unreachable. This
  method allows such loops to be garbage collected. This is done in three
  steps:
  	1. Remove user-created subclasses from the 'subclasses' set and from
  Smalltalk. Only remove classes whose name begins with 'Player' and which
  have no references.
  	2. Do a full garbage collection.
  	3. Enumerate all Metaclasses and find those whose soleInstance's
  superclass is this class. Reset the subclasses set to this set of
  classes, and add back to Smalltalk."
  	"Player freeUnreferencedSubclasses"
  
  	| oldFree candidatesForRemoval class |
  	oldFree := Smalltalk garbageCollect.
  	candidatesForRemoval := self subclasses asOrderedCollection select:
  		[:aClass | (aClass name beginsWith: 'Player') and: [aClass name
  endsWithDigit]].
  
  	"Break all system links and then perform garbage collection."
  	candidatesForRemoval do:
  		[:c | self removeSubclass: c.  "Break downward subclass pointers."
+ 		c environment removeKey: c name ifAbsent: [].  "Break binding of global
- 		Smalltalk removeKey: c name ifAbsent: [].  "Break binding of global
  name"].
  	candidatesForRemoval := nil.
  	Smalltalk garbageCollect.  "Now this should reclaim all unused
  subclasses"
  
  	"Now reconstruct system links to subclasses with valid references."
  	"First restore any global references via associations"
  	(Association allSubInstances select:
  			[:assn | (assn key isSymbol)
  					and: [(assn key beginsWith: 'Player')
  					and: [assn key endsWithDigit]]])
  		do: [:assn | class := assn value.
  			(class isKindOf: self class) ifTrue:
  				[self addSubclass: class.
+ 				class environment add: assn]].
- 				Smalltalk add: assn]].
  	"Then restore any further direct references, creating new
  associations."
  	(Metaclass allInstances select:
  			[:m | (m soleInstance name beginsWith: 'Player')
  					and: [m soleInstance name endsWithDigit]])
  		do: [:m | class := m soleInstance.
+ 			((class isKindOf: self class) and: [(class environment includesKey: class
- 			((class isKindOf: self class) and: [(Smalltalk includesKey: class
  name) not]) ifTrue:
  				[self addSubclass: class.
+ 				class environment at: class name put: class]].
- 				Smalltalk at: class name put: class]].
  	SystemOrganization removeMissingClasses.
  	^ Smalltalk garbageCollect - oldFree
  !

Item was changed:
  ----- Method: StandardScriptingSystem>>cleanupsForRelease (in category '*Etoys-utilities') -----
  cleanupsForRelease
  	"Miscellaneous space cleanups to do before a release."
  	"EToySystem cleanupsForRelease"
  
  	Socket deadServer: ''.  "Don't reveal any specific server name"
  	HandMorph initialize.  "free cached ColorChart"
  	PaintBoxMorph initialize.	"forces Prototype to let go of extra things it might hold"
+ 	Smalltalk globals removeKey: #AA ifAbsent: [].
+ 	Smalltalk globals removeKey: #BB ifAbsent: [].
+ 	Smalltalk globals removeKey: #CC ifAbsent: [].
+ 	Smalltalk globals removeKey: #DD ifAbsent: [].
+ 	Smalltalk globals removeKey: #Temp ifAbsent: [].
- 	Smalltalk removeKey: #AA ifAbsent: [].
- 	Smalltalk removeKey: #BB ifAbsent: [].
- 	Smalltalk removeKey: #CC ifAbsent: [].
- 	Smalltalk removeKey: #DD ifAbsent: [].
- 	Smalltalk removeKey: #Temp ifAbsent: [].
  
  	ScriptingSystem reclaimSpace.
  	Smalltalk cleanOutUndeclared.
  	Smalltalk reclaimDependents.
  	Smalltalk forgetDoIts.
  	Smalltalk removeEmptyMessageCategories.
  	Symbol rehash!




More information about the Squeak-dev mailing list