3.7 to MVC (was Re: [Q] I find this code in 3.9 image and wish know if is correct)

Lic. Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Wed Aug 17 21:35:24 UTC 2005


Boris Gaertner puso en su mail :

> Yes, I have a script to strip the image 3.7 #5989 basic. This gives
> an MVC-only image of approx. 1.6 MBytes with 3.6 MBytes
> of sources.
> 
> I plan to include this script into the next version of my MVC
> tutorial, but that tutorial requires still some work. For now,
> I placed the script here:
> http://bgaertner.gmxhome.de/Shrink36.html
> (The same page that provides access to earlier shrinking
> scripts)
> 
> For some months, I did almost nothing for Squeak: In
> april, I began a new job and had to move myself and all my
> havings. Most of my things are still at my former livingplace,
> but I managed to move my computer. I hope that I will
> soon be able to participate more actively in the Squeak
> community, but for now, my weekends are still dedicated
> to the difficult process of moving.
> 
>> Greetings,
> Boris

Boris:
One more time your are the shrinking champion.
Squeak3.7-5989-Boris.image (with network and FFI what I need ) is 1.9 Mb.
Smalltalk obsoleteClasses size 146.

I suggest add the following to your code (from ReleaseBuilder)

!SmalltalkImage methodsFor: 'image cleanup' stamp: 'edc 8/17/2005 07:53'!
fixObsoleteReferences
    | informee obsoleteBindings obsName realName realClass replace arreglar
|
"SmalltalkImage current fixObsoleteReferences"

    Preference allInstances do: [:each |
        informee _ each instVarNamed: #changeInformee.
        ((informee isKindOf: Behavior)
            and: [informee isObsolete])
            ifTrue: [
                Transcript show: each name; cr.
replace _  Smalltalk at: (informee name) ifAbsent:[].
                replace ifNotNil: [each instVarNamed: #changeInformee put:
(Smalltalk at: (informee name copyReplaceAll: 'AnObsolete' with: '')
asSymbol)]]].
    CompiledMethod allInstances do: [:method |
        obsoleteBindings _ method literals select: [:literal |
            literal isVariableBinding
                and: [literal value isBehavior]
                and: [literal value isObsolete]].
        obsoleteBindings do: [:binding |
            obsName _ binding value name.
            Transcript show: 'Binding: '; show: obsName; cr.
            realName _ obsName copyReplaceAll: 'AnObsolete' with: ''.
            realClass _ Smalltalk at: realName asSymbol ifAbsent:
[UndefinedObject].
            binding isSpecialWriteBinding
                ifTrue: [binding privateSetKey: binding key value:
realClass]
                ifFalse: [binding key: binding key value: realClass]]].


    Behavior flushObsoleteSubclasses.
    Smalltalk garbageCollect; garbageCollect.

Safe reduce to Smalltalk obsoleteClasses size 39
    
    (Smalltalk obsoleteClasses) do: [:c | c allInstancesDo: [:I
becomeForward: nil].
         c becomeForward: nil]].

Blows image, as expected, from here I do manual rip of obsoletes.

Numbers could be different as starting image was not  a clean one, just a
rapid test  
       



	

	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 




More information about the Squeak-dev mailing list