The Trunk: System-cmm.586.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-cmm.586.mcz

commits-2
Chris Muller uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-cmm.586.mcz

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

Name: System-cmm.586
Author: cmm
Time: 31 August 2013, 3:29:01.755 pm
UUID: bbffd13c-e516-462d-ac89-e3880a28c382
Ancestors: System-fbs.585

- Remove modal confirmation pop-up buried in system code.  If this is necessary it should be invoked from calling code.
- Factor SmalltalkImage>>#unloadAllKnownPackages into several smaller methods to allow more deliberate shrinking.
- Remove method referring to undefined "ScrapsBook".

=============== Diff against System-fbs.585 ===============

Item was changed:
  ----- Method: SmalltalkImage>>cleanUp:except: (in category 'housekeeping') -----
+ cleanUp: aggressive except: exclusions
- cleanUp: aggressive except: exclusions
  "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
  Leave out any classes specifically listed in exclusions."
-
  "Smalltalk cleanUp: true except: {Project. ChangeSet}"
+ "Find all classes implementing #cleanUp or cleanUp:"
+ | classes |
+ classes := Smalltalk allClasses select:
+ [ : eachClass | (eachClass class includesSelector: #cleanUp) or:
+ [ (eachClass class includesSelector: #cleanUp:) and: [ (exclusions includes: eachClass) not ] ] ].
+ "Arrange classes in superclass order, superclasses before subclasses, so that specific cleanup (like MethodDictionary compaction) will run after generic superclass cleanup (HashedCollection rehashing). Otherwise generic superclass cleanup might undo specific one (in this case rehashing will undo a good bit of MD compaction)."
+ (ChangeSet superclassOrder: classes)
+ do: [ : aClass | aClass cleanUp: aggressive ]
+ displayingProgress: [ : aClass | 'Cleaning up in ' , aClass name ]!
-
- ^self cleanUp: aggressive except: exclusions confirming: aggressive!

Item was removed:
- ----- Method: SmalltalkImage>>cleanUp:except:confirming: (in category 'housekeeping') -----
- cleanUp: aggressive except: exclusions confirming: aBool
- "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
- Leave out any classes specifically listed in exclusions."
-
- "Smalltalk cleanUp: true except: {Project. ChangeSet}"
-
- | classes |
- aBool ifTrue:[
- "Give the user a chance to bail"
- (self confirm: 'Cleanup will destroy projects, change sets and more.
- Are you sure you want to proceed?') ifFalse:[^self].
- ].
-
- "Find all classes implementing #cleanUp or cleanUp:"
- classes := Smalltalk allClasses select:[:aClass|
- (aClass class includesSelector: #cleanUp)
- or:[aClass class includesSelector: #cleanUp:]
- ].
-
- "Leave out the classes in the exclusion set"
- classes := classes reject:[:aClass| exclusions includes: aClass].
-
- "Arrange classes in superclass order, superclasses before subclasses.
- This will ensure that specific cleanup (like MethodDictionary compaction)
- will run after generic superclass cleanup (HashedCollection rehashing).
- Otherwise generic superclass cleanup might undo specific one (in this
- case rehashing will undo a good bit of MD compaction)."
- classes := ChangeSet superclassOrder: classes.
-
- "Run the cleanup code"
- classes
- do:[:aClass| aClass cleanUp: aggressive]
- displayingProgress:[:aClass| 'Cleaning up in ', aClass name].!

Item was added:
+ ----- Method: SmalltalkImage>>cleanUpEtoys (in category 'shrinking') -----
+ cleanUpEtoys
+ StandardScriptingSystem removeUnreferencedPlayers.
+ Project removeAllButCurrent.
+ #('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' ) do:
+ [ : each | SystemOrganization removeSystemCategory: each ].
+ World dumpPresenter.
+ Presenter defaultPresenterClass: nil.
+ Preferences removePreference: #allowEtoyUserCustomEvents.
+ !

Item was added:
+ ----- Method: SmalltalkImage>>removeChangeSets (in category 'shrinking') -----
+ removeChangeSets
+ ChangeSet removeChangeSetsNamedSuchThat:
+ [ : each | (each == ChangeSet current) not ].
+ ChangeSet current
+ clear ;
+ name: 'Unnamed1'!

Item was added:
+ ----- Method: SmalltalkImage>>shrink (in category 'shrinking') -----
+ shrink
+ "Clean up everything we know how to clean up that can be restored."
+ "Prepare unloading"
+ self zapMVCprojects.
+ Flaps disableGlobalFlaps: false.
+ self cleanUpEtoys.
+ "Yeow, why turn off listening for system changes?"
+ self
+ at: #ServiceRegistry
+ ifPresent: [ : aClass | SystemChangeNotifier uniqueInstance noMoreNotificationsFor: aClass ].
+ self unloadReloadablePackages.
+ "Post-unload cleanup"
+ SmalltalkImage cleanUp.
+ MCWorkingCopy flushObsoletePackageInfos.
+ "aggressive cleanUp"
+ SystemOrganization removeSystemCategory: 'UserObjects'.
+ ScheduledControllers := nil.
+ SystemOrganization removeEmptyCategories.
+ StandardScriptingSystem initialize.
+ "aggressive cleanUp"
+ self removeChangeSets.
+ self
+ at: #Browser
+ ifPresent:
+ [ : br | br initialize ].
+ DebuggerMethodMap voidMapCache.
+ DataStream initialize.
+ Smalltalk garbageCollect!

Item was added:
+ ----- Method: SmalltalkImage>>shrinkAndCleanDesktop (in category 'shrinking') -----
+ shrinkAndCleanDesktop
+ World removeAllMorphs.
+ self shrink.
+ MorphicProject defaultFill: (Color gray: 0.9).
+ World color: (Color gray: 0.9)!

Item was removed:
- ----- Method: SmalltalkImage>>unloadAllKnownPackages (in category 'shrinking') -----
- unloadAllKnownPackages
- "Unload all packages we know how to unload and reload"
-
- "Prepare unloading"
- Smalltalk zapMVCprojects.
- Flaps disableGlobalFlaps: false.
- StandardScriptingSystem removeUnreferencedPlayers.
- Project removeAllButCurrent.
- #('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' )
- do: [:each | SystemOrganization removeSystemCategory: each].
- Smalltalk at: #ServiceRegistry ifPresent:[:aClass|
- SystemChangeNotifier uniqueInstance
- noMoreNotificationsFor: aClass.
- ].
- World removeAllMorphs.
-
- "Go unloading"
- #( 'ReleaseBuilder' 'ScriptLoader'
- '311Deprecated' '39Deprecated'
- 'Universes' 'SMLoader' 'SMBase' 'Installer-Core'
- 'VersionNumberTests' 'VersionNumber'
- 'Services-Base' 'PreferenceBrowser' 'Nebraska'
- 'ToolBuilder-MVC' 'ST80Tools' 'ST80Tests' 'ST80'
- 'CompressionTests'
- 'CollectionsTests' 'GraphicsTests' 'KernelTests'  'MorphicTests'
- 'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests'
- 'SystemChangeNotification-Tests' 'FlexibleVocabularies'
- 'EToys' 'Protocols' 'XML-Parser' 'Tests' 'SUnitGUI'
- 'Help-Squeak' 'HelpSystem' 'SystemReporter'
- ) do: [:pkgName|
- (MCPackage named: pkgName) unload.
- MCMcmUpdater disableUpdatesOfPackage: pkgName.
- ].
- "Traits use custom unload"
- Smalltalk at: #Trait ifPresent:[:aClass| aClass unloadTraits].
-
- "Post-unload cleanup"
- SmalltalkImage cleanUp.
- MCWorkingCopy flushObsoletePackageInfos. "aggressive cleanUp"
- SystemOrganization removeSystemCategory: 'UserObjects'.
- Presenter defaultPresenterClass: nil.
- World dumpPresenter.
- ScheduledControllers := nil.
- Preferences removePreference: #allowEtoyUserCustomEvents.
- SystemOrganization removeEmptyCategories.
- StandardScriptingSystem initialize. "aggressive cleanUp"
- ChangeSet removeChangeSetsNamedSuchThat:[:cs | (cs == ChangeSet current) not].
- ChangeSet current clear.
- ChangeSet current name: 'Unnamed1'.
- Smalltalk at: #Browser ifPresent:[:br| br initialize].
- DebuggerMethodMap voidMapCache.
- DataStream initialize.
-
- Smalltalk garbageCollect.
- MorphicProject defaultFill: (Color gray: 0.9).
- World color: (Color gray: 0.9).
- !

Item was added:
+ ----- Method: SmalltalkImage>>unloadReloadablePackages (in category 'shrinking') -----
+ unloadReloadablePackages
+ "Unload packages which can be reloaded."
+ #('ReleaseBuilder' 'ScriptLoader' '311Deprecated' '39Deprecated' 'Universes' 'SMLoader' 'SMBase' 'VersionNumberTests' 'VersionNumber' 'Services-Base' 'PreferenceBrowser' 'Nebraska' 'ToolBuilder-MVC' 'ST80Tools' 'ST80Tests' 'ST80' 'CompressionTests' 'CollectionsTests' 'GraphicsTests' 'KernelTests' 'MorphicTests' 'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests' 'SystemChangeNotification-Tests' 'FlexibleVocabularies' 'EToys' 'Protocols' 'XML-Parser' 'Tests' 'SUnitGUI' 'Help-Squeak' 'HelpSystem' 'SystemReporter' ) do: [ : pkgName | Installer mc unload: pkgName ].
+ "Traits use custom unload"
+ self
+ at: #Trait
+ ifPresent: [ : aClass | aClass unloadTraits ]!

Item was removed:
- ----- Method: Utilities class>>cleanUp: (in category 'class initialization') -----
- cleanUp: agressive
- "Nuke the scraps book when cleaning aggressively"
-
- agressive ifTrue:[ScrapsBook := nil].!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-cmm.586.mcz

Chris Muller-3
Hi Frank, with this shrink-trunk.st can be shorter, and using code under SCM:

      Smalltalk unloadReloadablePackages; cleanUp

On Sat, Aug 31, 2013 at 3:29 PM,  <[hidden email]> wrote:

> Chris Muller uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-cmm.586.mcz
>
> ==================== Summary ====================
>
> Name: System-cmm.586
> Author: cmm
> Time: 31 August 2013, 3:29:01.755 pm
> UUID: bbffd13c-e516-462d-ac89-e3880a28c382
> Ancestors: System-fbs.585
>
> - Remove modal confirmation pop-up buried in system code.  If this is necessary it should be invoked from calling code.
> - Factor SmalltalkImage>>#unloadAllKnownPackages into several smaller methods to allow more deliberate shrinking.
> - Remove method referring to undefined "ScrapsBook".
>
> =============== Diff against System-fbs.585 ===============
>
> Item was changed:
>   ----- Method: SmalltalkImage>>cleanUp:except: (in category 'housekeeping') -----
> + cleanUp: aggressive except: exclusions
> - cleanUp: aggressive except: exclusions
>         "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
>         Leave out any classes specifically listed in exclusions."
> -
>         "Smalltalk cleanUp: true except: {Project. ChangeSet}"
> +       "Find all classes implementing #cleanUp or cleanUp:"
> +       | classes |
> +       classes := Smalltalk allClasses select:
> +               [ : eachClass | (eachClass class includesSelector: #cleanUp) or:
> +                       [ (eachClass class includesSelector: #cleanUp:) and: [ (exclusions includes: eachClass) not ] ] ].
> +       "Arrange classes in superclass order, superclasses before subclasses, so that specific cleanup (like MethodDictionary compaction) will run after generic superclass cleanup (HashedCollection rehashing). Otherwise generic superclass cleanup might undo specific one (in this case rehashing will undo a good bit of MD compaction)."
> +       (ChangeSet superclassOrder: classes)
> +               do: [ : aClass | aClass cleanUp: aggressive ]
> +               displayingProgress: [ : aClass | 'Cleaning up in ' , aClass name ]!
> -
> -       ^self cleanUp: aggressive except: exclusions confirming: aggressive!
>
> Item was removed:
> - ----- Method: SmalltalkImage>>cleanUp:except:confirming: (in category 'housekeeping') -----
> - cleanUp: aggressive except: exclusions confirming: aBool
> -       "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
> -       Leave out any classes specifically listed in exclusions."
> -
> -       "Smalltalk cleanUp: true except: {Project. ChangeSet}"
> -
> -       | classes |
> -       aBool ifTrue:[
> -               "Give the user a chance to bail"
> -               (self confirm: 'Cleanup will destroy projects, change sets and more.
> - Are you sure you want to proceed?') ifFalse:[^self].
> -       ].
> -
> -       "Find all classes implementing #cleanUp or cleanUp:"
> -       classes := Smalltalk allClasses select:[:aClass|
> -               (aClass class includesSelector: #cleanUp)
> -                       or:[aClass class includesSelector: #cleanUp:]
> -       ].
> -
> -       "Leave out the classes in the exclusion set"
> -       classes := classes reject:[:aClass| exclusions includes: aClass].
> -
> -       "Arrange classes in superclass order, superclasses before subclasses.
> -       This will ensure that specific cleanup (like MethodDictionary compaction)
> -       will run after generic superclass cleanup (HashedCollection rehashing).
> -       Otherwise generic superclass cleanup might undo specific one (in this
> -       case rehashing will undo a good bit of MD compaction)."
> -       classes := ChangeSet superclassOrder: classes.
> -
> -       "Run the cleanup code"
> -       classes
> -               do:[:aClass| aClass cleanUp: aggressive]
> -               displayingProgress:[:aClass| 'Cleaning up in ', aClass name].!
>
> Item was added:
> + ----- Method: SmalltalkImage>>cleanUpEtoys (in category 'shrinking') -----
> + cleanUpEtoys
> +       StandardScriptingSystem removeUnreferencedPlayers.
> +       Project removeAllButCurrent.
> +       #('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' ) do:
> +               [ : each | SystemOrganization removeSystemCategory: each ].
> +       World dumpPresenter.
> +       Presenter defaultPresenterClass: nil.
> +       Preferences removePreference: #allowEtoyUserCustomEvents.
> + !
>
> Item was added:
> + ----- Method: SmalltalkImage>>removeChangeSets (in category 'shrinking') -----
> + removeChangeSets
> +       ChangeSet removeChangeSetsNamedSuchThat:
> +               [ : each | (each == ChangeSet current) not ].
> +       ChangeSet current
> +                clear ;
> +                name: 'Unnamed1'!
>
> Item was added:
> + ----- Method: SmalltalkImage>>shrink (in category 'shrinking') -----
> + shrink
> +       "Clean up everything we know how to clean up that can be restored."
> +       "Prepare unloading"
> +       self zapMVCprojects.
> +       Flaps disableGlobalFlaps: false.
> +       self cleanUpEtoys.
> + "Yeow, why turn off listening for system changes?"
> +       self
> +               at: #ServiceRegistry
> +               ifPresent: [ : aClass | SystemChangeNotifier uniqueInstance noMoreNotificationsFor: aClass ].
> +       self unloadReloadablePackages.
> +       "Post-unload cleanup"
> +       SmalltalkImage cleanUp.
> +       MCWorkingCopy flushObsoletePackageInfos.
> +       "aggressive cleanUp"
> +       SystemOrganization removeSystemCategory: 'UserObjects'.
> +       ScheduledControllers := nil.
> +       SystemOrganization removeEmptyCategories.
> +       StandardScriptingSystem initialize.
> +       "aggressive cleanUp"
> +       self removeChangeSets.
> +       self
> +               at: #Browser
> +               ifPresent:
> +                       [ : br | br initialize ].
> +       DebuggerMethodMap voidMapCache.
> +       DataStream initialize.
> +       Smalltalk garbageCollect!
>
> Item was added:
> + ----- Method: SmalltalkImage>>shrinkAndCleanDesktop (in category 'shrinking') -----
> + shrinkAndCleanDesktop
> +       World removeAllMorphs.
> +       self shrink.
> +       MorphicProject defaultFill: (Color gray: 0.9).
> +       World color: (Color gray: 0.9)!
>
> Item was removed:
> - ----- Method: SmalltalkImage>>unloadAllKnownPackages (in category 'shrinking') -----
> - unloadAllKnownPackages
> -       "Unload all packages we know how to unload and reload"
> -
> -       "Prepare unloading"
> -       Smalltalk zapMVCprojects.
> -       Flaps disableGlobalFlaps: false.
> -       StandardScriptingSystem removeUnreferencedPlayers.
> -       Project removeAllButCurrent.
> -       #('Morphic-UserObjects' 'EToy-UserObjects' 'Morphic-Imported' )
> -               do: [:each | SystemOrganization removeSystemCategory: each].
> -       Smalltalk at: #ServiceRegistry ifPresent:[:aClass|
> -               SystemChangeNotifier uniqueInstance
> -                       noMoreNotificationsFor: aClass.
> -       ].
> -       World removeAllMorphs.
> -
> -       "Go unloading"
> -       #(      'ReleaseBuilder' 'ScriptLoader'
> -               '311Deprecated' '39Deprecated'
> -               'Universes' 'SMLoader' 'SMBase' 'Installer-Core'
> -               'VersionNumberTests' 'VersionNumber'
> -               'Services-Base' 'PreferenceBrowser' 'Nebraska'
> -               'ToolBuilder-MVC' 'ST80Tools' 'ST80Tests' 'ST80'
> -               'CompressionTests'
> -               'CollectionsTests' 'GraphicsTests' 'KernelTests'  'MorphicTests'
> -               'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests'
> -               'SystemChangeNotification-Tests' 'FlexibleVocabularies'
> -               'EToys' 'Protocols' 'XML-Parser' 'Tests' 'SUnitGUI'
> -               'Help-Squeak' 'HelpSystem' 'SystemReporter'
> -       ) do: [:pkgName|
> -                       (MCPackage named: pkgName) unload.
> -                       MCMcmUpdater disableUpdatesOfPackage: pkgName.
> -                       ].
> -       "Traits use custom unload"
> -       Smalltalk at: #Trait ifPresent:[:aClass| aClass unloadTraits].
> -
> -       "Post-unload cleanup"
> -       SmalltalkImage cleanUp.
> -       MCWorkingCopy flushObsoletePackageInfos. "aggressive cleanUp"
> -       SystemOrganization removeSystemCategory: 'UserObjects'.
> -       Presenter defaultPresenterClass: nil.
> -       World dumpPresenter.
> -       ScheduledControllers := nil.
> -       Preferences removePreference: #allowEtoyUserCustomEvents.
> -       SystemOrganization removeEmptyCategories.
> -       StandardScriptingSystem initialize. "aggressive cleanUp"
> -       ChangeSet removeChangeSetsNamedSuchThat:[:cs | (cs == ChangeSet current) not].
> -       ChangeSet current clear.
> -       ChangeSet current name: 'Unnamed1'.
> -       Smalltalk at: #Browser ifPresent:[:br| br initialize].
> -       DebuggerMethodMap voidMapCache.
> -       DataStream initialize.
> -
> -       Smalltalk garbageCollect.
> -       MorphicProject defaultFill: (Color gray: 0.9).
> -       World color: (Color gray: 0.9).
> - !
>
> Item was added:
> + ----- Method: SmalltalkImage>>unloadReloadablePackages (in category 'shrinking') -----
> + unloadReloadablePackages
> +       "Unload packages which can be reloaded."
> +       #('ReleaseBuilder' 'ScriptLoader' '311Deprecated' '39Deprecated' 'Universes' 'SMLoader' 'SMBase' 'VersionNumberTests' 'VersionNumber' 'Services-Base' 'PreferenceBrowser' 'Nebraska' 'ToolBuilder-MVC' 'ST80Tools' 'ST80Tests' 'ST80' 'CompressionTests' 'CollectionsTests' 'GraphicsTests' 'KernelTests' 'MorphicTests' 'MultilingualTests' 'NetworkTests' 'ToolsTests' 'TraitsTests' 'SystemChangeNotification-Tests' 'FlexibleVocabularies' 'EToys' 'Protocols' 'XML-Parser' 'Tests' 'SUnitGUI' 'Help-Squeak' 'HelpSystem' 'SystemReporter' ) do: [ : pkgName | Installer mc unload: pkgName ].
> +       "Traits use custom unload"
> +       self
> +               at: #Trait
> +               ifPresent: [ : aClass | aClass unloadTraits ]!
>
> Item was removed:
> - ----- Method: Utilities class>>cleanUp: (in category 'class initialization') -----
> - cleanUp: agressive
> -       "Nuke the scraps book when cleaning aggressively"
> -
> -       agressive ifTrue:[ScrapsBook := nil].!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-cmm.586.mcz

Levente Uzonyi-2
In reply to this post by commits-2
On Sat, 31 Aug 2013, [hidden email] wrote:

> Chris Muller uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-cmm.586.mcz
>
> ==================== Summary ====================
>
> Name: System-cmm.586
> Author: cmm
> Time: 31 August 2013, 3:29:01.755 pm
> UUID: bbffd13c-e516-462d-ac89-e3880a28c382
> Ancestors: System-fbs.585
>
> - Remove modal confirmation pop-up buried in system code.  If this is necessary it should be invoked from calling code.
> - Factor SmalltalkImage>>#unloadAllKnownPackages into several smaller methods to allow more deliberate shrinking.
> - Remove method referring to undefined "ScrapsBook".
>
> =============== Diff against System-fbs.585 ===============
>
> Item was changed:
>  ----- Method: SmalltalkImage>>cleanUp:except: (in category 'housekeeping') -----
> + cleanUp: aggressive except: exclusions
> - cleanUp: aggressive except: exclusions
>   "Clean up. When aggressive is true, this will destroy projects, change sets, etc.
>   Leave out any classes specifically listed in exclusions."
> -
>   "Smalltalk cleanUp: true except: {Project. ChangeSet}"
> + "Find all classes implementing #cleanUp or cleanUp:"
> + | classes |
> + classes := Smalltalk allClasses select:
> + [ : eachClass | (eachClass class includesSelector: #cleanUp) or:
> + [ (eachClass class includesSelector: #cleanUp:) and: [ (exclusions includes: eachClass) not ] ] ].
> + "Arrange classes in superclass order, superclasses before subclasses, so that specific cleanup (like MethodDictionary compaction) will run after generic superclass cleanup (HashedCollection rehashing). Otherwise generic superclass cleanup might undo specific one (in this case rehashing will undo a good bit of MD compaction)."

I don't really get this comment. MethodDictionary has no specific cleanUp
method, because the one in HashedCollection handles all sub-instances.


Levente

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-cmm.586.mcz

Chris Muller-3
I'm pretty sure Andreas wrote that comment.  I don't know what
MethodDictionary "compaction" is, but maybe it is not called from
elsewhere than its cleanUp method..??

On Wed, Sep 4, 2013 at 8:26 AM, Levente Uzonyi <[hidden email]> wrote:

> On Sat, 31 Aug 2013, [hidden email] wrote:
>
>> Chris Muller uploaded a new version of System to project The Trunk:
>> http://source.squeak.org/trunk/System-cmm.586.mcz
>>
>> ==================== Summary ====================
>>
>> Name: System-cmm.586
>> Author: cmm
>> Time: 31 August 2013, 3:29:01.755 pm
>> UUID: bbffd13c-e516-462d-ac89-e3880a28c382
>> Ancestors: System-fbs.585
>>
>> - Remove modal confirmation pop-up buried in system code.  If this is
>> necessary it should be invoked from calling code.
>> - Factor SmalltalkImage>>#unloadAllKnownPackages into several smaller
>> methods to allow more deliberate shrinking.
>> - Remove method referring to undefined "ScrapsBook".
>>
>> =============== Diff against System-fbs.585 ===============
>>
>> Item was changed:
>>  ----- Method: SmalltalkImage>>cleanUp:except: (in category
>> 'housekeeping') -----
>> + cleanUp: aggressive except: exclusions
>> - cleanUp: aggressive except: exclusions
>>         "Clean up. When aggressive is true, this will destroy projects,
>> change sets, etc.
>>         Leave out any classes specifically listed in exclusions."
>> -
>>         "Smalltalk cleanUp: true except: {Project. ChangeSet}"
>> +       "Find all classes implementing #cleanUp or cleanUp:"
>> +       | classes |
>> +       classes := Smalltalk allClasses select:
>> +               [ : eachClass | (eachClass class includesSelector:
>> #cleanUp) or:
>> +                       [ (eachClass class includesSelector: #cleanUp:)
>> and: [ (exclusions includes: eachClass) not ] ] ].
>> +       "Arrange classes in superclass order, superclasses before
>> subclasses, so that specific cleanup (like MethodDictionary compaction) will
>> run after generic superclass cleanup (HashedCollection rehashing). Otherwise
>> generic superclass cleanup might undo specific one (in this case rehashing
>> will undo a good bit of MD compaction)."
>
>
> I don't really get this comment. MethodDictionary has no specific cleanUp
> method, because the one in HashedCollection handles all sub-instances.
>
>
> Levente
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-cmm.586.mcz

Levente Uzonyi-2
On Wed, 4 Sep 2013, Chris Muller wrote:

> I'm pretty sure Andreas wrote that comment.  I don't know what
> MethodDictionary "compaction" is, but maybe it is not called from
> elsewhere than its cleanUp method..??

I missed that you copied that comment from another method. Its content is
mostly obsolete since 4.2 or 4.3.

The compaction means that the empty slots in the dictionaries (and all
HashedCollections) will be removed if possible to save space. If you
create a new class, then its MethodDictionary will have 32 empty slots.
This is because you'll probably add methods to that class (#fileIn), and
the only way a MethodDictionary can grow is to use #becomeForward:, which
happens pretty often for the first few methods, if the dictionary is too
small. After compaction of and empty MethodDictionary with 32 slots, there
will only be one slot, which saves 124 bytes for that class.


Levente

>
> On Wed, Sep 4, 2013 at 8:26 AM, Levente Uzonyi <[hidden email]> wrote:
>> On Sat, 31 Aug 2013, [hidden email] wrote:
>>
>>> Chris Muller uploaded a new version of System to project The Trunk:
>>> http://source.squeak.org/trunk/System-cmm.586.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: System-cmm.586
>>> Author: cmm
>>> Time: 31 August 2013, 3:29:01.755 pm
>>> UUID: bbffd13c-e516-462d-ac89-e3880a28c382
>>> Ancestors: System-fbs.585
>>>
>>> - Remove modal confirmation pop-up buried in system code.  If this is
>>> necessary it should be invoked from calling code.
>>> - Factor SmalltalkImage>>#unloadAllKnownPackages into several smaller
>>> methods to allow more deliberate shrinking.
>>> - Remove method referring to undefined "ScrapsBook".
>>>
>>> =============== Diff against System-fbs.585 ===============
>>>
>>> Item was changed:
>>>  ----- Method: SmalltalkImage>>cleanUp:except: (in category
>>> 'housekeeping') -----
>>> + cleanUp: aggressive except: exclusions
>>> - cleanUp: aggressive except: exclusions
>>>         "Clean up. When aggressive is true, this will destroy projects,
>>> change sets, etc.
>>>         Leave out any classes specifically listed in exclusions."
>>> -
>>>         "Smalltalk cleanUp: true except: {Project. ChangeSet}"
>>> +       "Find all classes implementing #cleanUp or cleanUp:"
>>> +       | classes |
>>> +       classes := Smalltalk allClasses select:
>>> +               [ : eachClass | (eachClass class includesSelector:
>>> #cleanUp) or:
>>> +                       [ (eachClass class includesSelector: #cleanUp:)
>>> and: [ (exclusions includes: eachClass) not ] ] ].
>>> +       "Arrange classes in superclass order, superclasses before
>>> subclasses, so that specific cleanup (like MethodDictionary compaction) will
>>> run after generic superclass cleanup (HashedCollection rehashing). Otherwise
>>> generic superclass cleanup might undo specific one (in this case rehashing
>>> will undo a good bit of MD compaction)."
>>
>>
>> I don't really get this comment. MethodDictionary has no specific cleanUp
>> method, because the one in HashedCollection handles all sub-instances.
>>
>>
>> Levente
>>
>
>