[squeak-dev] The Trunk: EToys-mt.133.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 12 16:52:00 UTC 2016


Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.133.mcz

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

Name: EToys-mt.133
Author: mt
Time: 12 April 2016, 6:51:41.830201 pm
UUID: 400acaea-780d-c145-8a55-5eeb945b644d
Ancestors: EToys-mt.132

Simplifies uni-class clean-up. The method #allSubclassesWithLevelDo:startingLevel: is misleading because it is only a counter and no filter.

=============== Diff against EToys-mt.132 ===============

Item was changed:
  ----- Method: Player class>>removeUninstantiatedSubclassesSilently (in category 'housekeeping') -----
  removeUninstantiatedSubclassesSilently
  	"Remove the classes of any subclasses that have neither instances nor subclasses.  Answer the number of bytes reclaimed"
  	"Player removeUninstantiatedSubclassesSilently"
  
+ 	| oldFree |
- 	| candidatesForRemoval  oldFree |
- 
  	oldFree := Smalltalk garbageCollect.
+ 		
+ 	self allSubclasses
+ 		select: [:c | (c isSystemDefined not and: [c instanceCount = 0]) and: [c subclasses isEmpty]]
+ 		thenDo: [:c | c removeFromSystemUnlogged].
+ 		
- 	candidatesForRemoval := OrderedCollection new.
- 	self allSubclassesWithLevelDo: [:e :l | candidatesForRemoval add: e] startingLevel: 2.
- 	candidatesForRemoval := candidatesForRemoval reverse.
- 	candidatesForRemoval :=
- 		candidatesForRemoval select: [:c |
- 			(c instanceCount = 0) and: [c subclasses size = 0]].
- 	candidatesForRemoval := candidatesForRemoval select:
- 		[:aClass | aClass isSystemDefined not].
- 	candidatesForRemoval do: [:c | c removeFromSystemUnlogged].
  	^ Smalltalk garbageCollect - oldFree!



More information about the Squeak-dev mailing list