[squeak-dev] The Trunk: System-cmm.586.mcz

Levente Uzonyi leves at elte.hu
Wed Sep 4 15:30:22 UTC 2013


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 <leves at elte.hu> wrote:
>> On Sat, 31 Aug 2013, commits at source.squeak.org 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
>>
>
>


More information about the Squeak-dev mailing list