ObjectMemory.st
changeset 335 1f1cc22f2aa5
parent 332 3326b1c813c8
child 339 e8658d38abfb
equal deleted inserted replaced
334:885080385f59 335:1f1cc22f2aa5
    31 
    31 
    32 ObjectMemory comment:'
    32 ObjectMemory comment:'
    33 COPYRIGHT (c) 1992 by Claus Gittinger
    33 COPYRIGHT (c) 1992 by Claus Gittinger
    34 	     All Rights Reserved
    34 	     All Rights Reserved
    35 
    35 
    36 $Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.38 1995-05-02 18:16:47 claus Exp $
    36 $Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.39 1995-05-03 15:30:06 claus Exp $
    37 '!
    37 '!
    38 
    38 
    39 !ObjectMemory class methodsFor:'documentation'!
    39 !ObjectMemory class methodsFor:'documentation'!
    40 
    40 
    41 copyright
    41 copyright
    52 "
    52 "
    53 !
    53 !
    54 
    54 
    55 version
    55 version
    56 "
    56 "
    57 $Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.38 1995-05-02 18:16:47 claus Exp $
    57 $Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.39 1995-05-03 15:30:06 claus Exp $
    58 "
    58 "
    59 !
    59 !
    60 
    60 
    61 documentation
    61 documentation
    62 "
    62 "
  2257 
  2257 
  2258     |viewsKnown savedIdleBlocks savedTimeoutBlocks savedTranscript
  2258     |viewsKnown savedIdleBlocks savedTimeoutBlocks savedTranscript
  2259      savedRoot|
  2259      savedRoot|
  2260 
  2260 
  2261     viewsKnown := Display knownViews.
  2261     viewsKnown := Display knownViews.
  2262     savedIdleBlocks := Display idleBlocks.
       
  2263     savedTimeoutBlocks := Display timeOutBlocks.
       
  2264     savedTranscript := Transcript.
  2262     savedTranscript := Transcript.
  2265     savedRoot := RootView.
  2263     savedRoot := RootView.
  2266 
  2264 
  2267     "a kludge: save image with modified knownViews, no idle- and timeoutblocks
  2265     "a kludge: save image with modified knownViews, 
  2268      and also Transcript set to StdErr ..."
  2266      and also Transcript set to StdErr ..."
  2269 
  2267 
  2270     Display knownViews:nil.
  2268     Display knownViews:nil.
  2271     Display idleBlocks:nil.
       
  2272     Display timeOutBlocks:nil.
       
  2273     RootView := nil.
  2269     RootView := nil.
  2274 
  2270 
  2275     Transcript := Stderr.
  2271     Transcript := Stderr.
  2276     Smalltalk startupClass:startupClass selector:startupSelector arguments:nil.
  2272     Smalltalk startupClass:startupClass selector:startupSelector arguments:nil.
  2277     self snapShotOn:aFileName.
  2273     self snapShotOn:aFileName.
  2278     Smalltalk startupClass:nil selector:nil arguments:nil.
  2274     Smalltalk startupClass:nil selector:nil arguments:nil.
  2279 
  2275 
  2280     RootView := savedRoot.
  2276     RootView := savedRoot.
  2281     Transcript := savedTranscript.
  2277     Transcript := savedTranscript.
  2282     Display knownViews:viewsKnown.
  2278     Display knownViews:viewsKnown.
  2283     Display idleBlocks:savedIdleBlocks.
  2279 
  2284     Display timeOutBlocks:savedTimeoutBlocks
  2280     "
  2285 
  2281      ObjectMemory applicationImageOn:'draw.img' for:DrawTool selector:#start
  2286     "ObjectMemory applicationImageOn:'draw.img' for:DrawTool selector:#start"
  2282     "
  2287     "ObjectMemory applicationImageOn:'pm.img' for:PMSimulator selector:#start"
       
  2288 !
  2283 !
  2289 
  2284 
  2290 minimumApplicationImageOn:aFileName for:startupClass selector:startupSelector
  2285 minimumApplicationImageOn:aFileName for:startupClass selector:startupSelector
  2291     "create a snapshot which will come up without any views 
  2286     "create a snapshot which will come up without any views 
  2292      but starts up an application by sending startupClass the startupSelector.
  2287      but starts up an application by sending startupClass the startupSelector.
  2312     "continue in old image"
  2307     "continue in old image"
  2313 
  2308 
  2314     OperatingSystem exec:(Arguments at:1)
  2309     OperatingSystem exec:(Arguments at:1)
  2315 	   withArguments:#('smalltalk' '-i' 'temp.img') , (Arguments copyFrom:2)
  2310 	   withArguments:#('smalltalk' '-i' 'temp.img') , (Arguments copyFrom:2)
  2316 
  2311 
  2317     "ObjectMemory minimumApplicationImageOn:'clock1.img' for:Clock selector:#start"
  2312     "
  2318     "ObjectMemory applicationImageOn:'clock2.img' for:Clock selector:#start"
  2313      ObjectMemory minimumApplicationImageOn:'draw1.img' for:DrawTool selector:#start
       
  2314      ObjectMemory applicationImageOn:'draw2.img' for:DrawTool selector:#start
       
  2315     "
  2319 !
  2316 !
  2320 
  2317 
  2321 stripImage
  2318 stripImage
  2322     "remove all unneeded stuff from the image - much more is possible here.
  2319     "remove all unneeded stuff from the image - much more is possible here.
  2323      EXPERIMENTAL and unfinished. Dont use this method."
  2320      EXPERIMENTAL and unfinished. Dont use this method."
  2329 	aClass methodArray do:[:aMethod |
  2326 	aClass methodArray do:[:aMethod |
  2330 	    aMethod source:''.
  2327 	    aMethod source:''.
  2331 	    aMethod category:#none 
  2328 	    aMethod category:#none 
  2332 	]
  2329 	]
  2333     ].
  2330     ].
       
  2331 
       
  2332     "remove some developpers classes"
       
  2333 
       
  2334     Smalltalk at:#Compiler put:Parser.
       
  2335     Smalltalk at:#Debugger put:MiniDebugger.
       
  2336     Smalltalk at:#Inspector put:MiniInspector.
       
  2337     Smalltalk at:#FileBrowser put:nil.
       
  2338     Smalltalk at:#SystemBrowser put:nil.
       
  2339     Debugger newDebugger.
       
  2340 
  2334     self garbageCollect
  2341     self garbageCollect
  2335 ! !
  2342 ! !