catch abortSignal when performing IGC's.
authorClaus Gittinger <cg@exept.de>
Thu, 02 Nov 1995 17:25:48 +0100
changeset 472 9c5121e7d3e8
parent 471 75cc0d87b910
child 473 f92507d781d2
catch abortSignal when performing IGC's. If cought, turn off IGC. This allows graceful execution, if IGC hits a bad object, enters debugger due to a SEGV and abort is pressed in the debugger.
ObjMem.st
ObjectMemory.st
--- a/ObjMem.st	Thu Nov 02 16:15:43 1995 +0100
+++ b/ObjMem.st	Thu Nov 02 17:25:48 1995 +0100
@@ -34,7 +34,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.61 1995-10-31 17:18:26 cg Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.62 1995-11-02 16:25:48 cg Exp $
 '!
 
 !ObjectMemory class methodsFor:'documentation'!
@@ -55,7 +55,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.61 1995-10-31 17:18:26 cg Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.62 1995-11-02 16:25:48 cg Exp $
 "
 !
 
@@ -1829,19 +1829,27 @@
 
     |done limit|
 
-    limit := IncrementalGCLimit.
-    (limit notNil and:[self oldSpaceAllocatedSinceLastGC > limit]) ifTrue:[
-	done := ObjectMemory gcStep
-    ] ifFalse:[
-	limit := FreeSpaceGCLimit.
-	(limit notNil and:[(self freeSpace + self freeListSpace) < limit]) ifTrue:[
-	    done := ObjectMemory gcStep.
-	    done ifTrue:[
-		self moreOldSpaceIfUseful
-	    ].
-	] ifFalse:[
-	    done := true
-	]
+    Object abortSignal handle:[:ex |
+	"/ in case of abort (from the debugger),
+	"/ disable gcSteps.
+	done := true.
+	IncrementalGCLimit := FreeSpaceGCLimit := nil.
+	'OBJMEM: IGC aborted; turning off incremental GC' errorPrintNL
+    ] do:[
+        limit := IncrementalGCLimit.
+        (limit notNil and:[self oldSpaceAllocatedSinceLastGC > limit]) ifTrue:[
+	    done := ObjectMemory gcStep
+        ] ifFalse:[
+	    limit := FreeSpaceGCLimit.
+	    (limit notNil and:[(self freeSpace + self freeListSpace) < limit]) ifTrue:[
+	        done := ObjectMemory gcStep.
+	        done ifTrue:[
+		    self moreOldSpaceIfUseful
+	        ].
+	    ] ifFalse:[
+	        done := true
+	    ]
+        ].
     ].
     ^ done not
 !
--- a/ObjectMemory.st	Thu Nov 02 16:15:43 1995 +0100
+++ b/ObjectMemory.st	Thu Nov 02 17:25:48 1995 +0100
@@ -34,7 +34,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.61 1995-10-31 17:18:26 cg Exp $
+$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.62 1995-11-02 16:25:48 cg Exp $
 '!
 
 !ObjectMemory class methodsFor:'documentation'!
@@ -55,7 +55,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.61 1995-10-31 17:18:26 cg Exp $
+$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.62 1995-11-02 16:25:48 cg Exp $
 "
 !
 
@@ -1829,19 +1829,27 @@
 
     |done limit|
 
-    limit := IncrementalGCLimit.
-    (limit notNil and:[self oldSpaceAllocatedSinceLastGC > limit]) ifTrue:[
-	done := ObjectMemory gcStep
-    ] ifFalse:[
-	limit := FreeSpaceGCLimit.
-	(limit notNil and:[(self freeSpace + self freeListSpace) < limit]) ifTrue:[
-	    done := ObjectMemory gcStep.
-	    done ifTrue:[
-		self moreOldSpaceIfUseful
-	    ].
-	] ifFalse:[
-	    done := true
-	]
+    Object abortSignal handle:[:ex |
+	"/ in case of abort (from the debugger),
+	"/ disable gcSteps.
+	done := true.
+	IncrementalGCLimit := FreeSpaceGCLimit := nil.
+	'OBJMEM: IGC aborted; turning off incremental GC' errorPrintNL
+    ] do:[
+        limit := IncrementalGCLimit.
+        (limit notNil and:[self oldSpaceAllocatedSinceLastGC > limit]) ifTrue:[
+	    done := ObjectMemory gcStep
+        ] ifFalse:[
+	    limit := FreeSpaceGCLimit.
+	    (limit notNil and:[(self freeSpace + self freeListSpace) < limit]) ifTrue:[
+	        done := ObjectMemory gcStep.
+	        done ifTrue:[
+		    self moreOldSpaceIfUseful
+	        ].
+	    ] ifFalse:[
+	        done := true
+	    ]
+        ].
     ].
     ^ done not
 !