diff -r 7eb5bedfaa1c -r e5019c22f40e ObjMem.st --- a/ObjMem.st Sat Aug 05 16:05:36 1995 +0200 +++ b/ObjMem.st Tue Aug 08 02:49:43 1995 +0200 @@ -34,7 +34,7 @@ COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.48 1995-08-03 01:15:54 claus Exp $ +$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.49 1995-08-08 00:47:48 claus Exp $ '! !ObjectMemory class methodsFor:'documentation'! @@ -55,7 +55,7 @@ version " -$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.48 1995-08-03 01:15:54 claus Exp $ +$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.49 1995-08-08 00:47:48 claus Exp $ " ! @@ -457,6 +457,59 @@ ^ LowSpaceSemaphore ! ! +!ObjectMemory class methodsFor:'VM messages'! + +infoPrinting:aBoolean + "turn on/off various informational printouts in the VM. + For example, the GC activity messages are controlled by + this flags setting. + The default is true, since (currently) those messages + are useful for ST/X developers." + +%{ /* NOCONTEXT */ + extern int __infoPrinting; + + __infoPrinting = (aBoolean == true); +%} +! + +infoPrinting + "return true, if various informational printouts in the VM + are turned on, false of off." + +%{ /* NOCONTEXT */ + extern int __infoPrinting; + + RETURN (__infoPrinting ? true : false); +%} +! + +debugPrinting:aBoolean + "turn on/off various debug printouts in the VM + in case of an error. For example, a double-notUnderstood + leads to a VM context dump if debugPrinting is on. + If off, those messages are suppressed. + The default is on, since these messages are only printed for + severe errors." + +%{ /* NOCONTEXT */ + extern int __debugPrinting; + + __debugPrinting = (aBoolean == true); +%} +! + +debugPrinting + "return true, if various debug printouts in the VM + are turned on, false of off." + +%{ /* NOCONTEXT */ + extern int __debugPrinting; + + RETURN (__debugPrinting ? true : false); +%} +! ! + !ObjectMemory class methodsFor:'dependents access'! dependents @@ -1459,6 +1512,21 @@ ! garbageCollect + "search for and free garbage in the oldSpace. + This can take a long time - especially, if paging is involved." + + "/ used to be + "/ self compressingGarbageCollect + "/ here; changed to default to markAndSweep + + self markAndSweep + + " + ObjectMemory garbageCollect + " +! + +compressingGarbageCollect "search for and free garbage in the oldSpace (newSpace is cleaned automatically) performing a COMPRESSING garbage collect. This can take a long time - especially, if paging is involved @@ -1472,21 +1540,7 @@ %} " - ObjectMemory garbageCollect - " -! - -reclaimSymbols - "reclaim unused symbols; - Unused symbols are (currently) not reclaimed automatically, - but only upon request with this method. - It takes some time to do this ... and it is NOT interruptable. - Future versions may do this automatically, while garbage collecting." -%{ - __reclaimSymbols(__context); -%} - " - ObjectMemory reclaimSymbols + ObjectMemory compressingGarbageCollect " ! @@ -1505,6 +1559,20 @@ " ! +reclaimSymbols + "reclaim unused symbols; + Unused symbols are (currently) not reclaimed automatically, + but only upon request with this method. + It takes some time to do this ... and it is NOT interruptable. + Future versions may do this automatically, while garbage collecting." +%{ + __reclaimSymbols(__context); +%} + " + ObjectMemory reclaimSymbols + " +! + gcStep "one incremental garbage collect step. Mark or sweep some small number of objects. This @@ -1571,13 +1639,13 @@ ! verboseGarbageCollect - "perform a compessing garbage collect and show some informational + "perform a compressing garbage collect and show some informational output on the Transcript" |nBytesBefore nReclaimed value unit| nBytesBefore := self oldSpaceUsed. - self garbageCollect. + self compressingGarbageCollect. nReclaimed := nBytesBefore - self oldSpaceUsed. nReclaimed > 0 ifTrue:[ nReclaimed > 1024 ifTrue:[ @@ -2651,4 +2719,3 @@ compactingGC self garbageCollect ! ! -