ObjMem.st
changeset 345 cf2301210c47
parent 339 e8658d38abfb
child 356 6c5ce0e1e7a8
--- a/ObjMem.st	Fri May 12 14:35:09 1995 +0200
+++ b/ObjMem.st	Tue May 16 19:09:45 1995 +0200
@@ -18,6 +18,7 @@
 			   ChildSignalInterruptHandler DisposeInterruptHandler
 			   RecursionInterruptHandler IOInterruptHandler
 			   CustomInterruptHandler
+			   RegisteredErrorInterruptHandlers
 
 			   AllocationFailureSignal LowSpaceSemaphore
 			   IncrementalGCLimit FreeSpaceGCLimit FreeSpaceGCAmount 
@@ -33,7 +34,7 @@
 COPYRIGHT (c) 1992 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.40 1995-05-08 03:30:02 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.41 1995-05-16 17:07:55 claus Exp $
 '!
 
 !ObjectMemory class methodsFor:'documentation'!
@@ -54,7 +55,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.40 1995-05-08 03:30:02 claus Exp $
+$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.41 1995-05-16 17:07:55 claus Exp $
 "
 !
 
@@ -84,7 +85,7 @@
 	SpyInterruptHandler             another alarm timer (from VM)
 	StepInterruptHandler            gets single step interrupts (from VM)
 	ExceptionInterruptHandler       gets floating point exceptions (from VM)
-	ErrorInterruptHandler           gets graphic device errors (from VM)
+	ErrorInterruptHandler           gets primitive errors (from VM)
 	MemoryInterruptHandler          gets soon-out-of-memory conditions (from VM)
 	SignalInterruptHandler          gets unix signals (from VM)
 	ChildSignalInterruptHandler     gets child death signals (from VM)
@@ -94,6 +95,11 @@
 	IOInterruptHandler              gets SIGIO unix signals (from VM)
 	CustomInterruptHandler          gets custom interrupts (from VM)
 
+	RegisteredErrorInterruptHandlers
+					associates errorID (as passed from primitive
+					to the __errorInterruptWithID() function)
+					with handlers.
+
 	IncrementalGCLimit              number of bytes, that must be allocated since
 					last full garbage collect to turn the incremental
 					collector on (at idle time).
@@ -185,7 +191,8 @@
 	customInterrupt                 - custom interrupt
 	ioInterrupt                     - SIGIO interrupt
 	timerInterrupt                  - alarm timer (SIGALRM)
-	errorInterrupt                  - display error
+	errorInterrupt:<id>             - errors from other primitives/subsystems
+					  (DisplayError)
 	spyInterrupt                    - spy timer interrupt (SIGVTALARM)
 	stepInterrupt                   - single step interrupt
 	disposeInterrupt                - finalization required
@@ -425,7 +432,7 @@
     MemoryInterruptHandler := self
 ! !
 
-!ObjectMemory class methodsFor:'signal access'!
+!ObjectMemory class methodsFor:'Signal constants'!
 
 allocationFailureSignal
     "return the signal raised when an object allocation failed"
@@ -684,6 +691,21 @@
     ErrorInterruptHandler := aHandler
 !
 
+registeredErrorInterruptHandlers
+    "return registered handlers"
+
+    ^ RegisteredErrorInterruptHandlers
+!
+
+registerErrorInterruptHandler:aHandler forID:errorIDSymbol
+    "register a handler"
+
+    RegisteredErrorInterruptHandlers isNil ifTrue:[
+	RegisteredErrorInterruptHandlers := IdentityDictionary new
+    ].
+    RegisteredErrorInterruptHandlers at:errorIDSymbol put:aHandler
+!
+
 signalInterruptHandler
     "return the handler for UNIX-signal interrupts"