-;;; a FIXNUM, to be interpreted as a native pointer, which serves
-;;; as a boundary to catch stack overflow
-;;;
-;;; When stack overflow is detected, this is to be bound to a new
-;;; value (allowing some more space for error handling) around the
-;;; call to ERROR.
-;;;
-;;; FIXME: Maybe (probably?) this should be in SB!VM. And maybe the
-;;; size of the buffer zone should be set in src/compiler/cpu/parms.lisp
-;;; instead of constantly 1Mb for all CPU architectures?
-(defvar *stack-exhaustion*
- ;; (initialized in cold init)
- )
-(defun !exhaust-cold-init ()
- (setf *stack-exhaustion*
- #.(native-address-encoded-as-fixnum
- #!+stack-grows-downward (+ sb!vm:control-stack-start (expt 2 20))
- #!+stack-grows-upward (- sb!vm:control-stack-end (expt 2 20)))))
-
-;;; FIXME: Even though this is only called when (> SAFETY (MAX SPEED SPACE))
-;;; it's still annoyingly wasteful for it to be a full function call.
-;;; It should probably be a VOP calling an assembly routine or something
-;;; like that.
-(defun %detect-stack-exhaustion ()
- ;; FIXME: Check the stack pointer against *STACK-EXHAUSTION*, and if
- ;; out of range signal an error (in a context where *S-E* has been
- ;; rebound to give some space to let error handling code do its
- ;; thing without new exhaustion problems).
- (values))