-
-;;; 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))
+(define-alien-routine ("protect_control_stack_guard_page"
+ %protect-control-stack-guard-page)
+ sb!alien:void
+ (thread-sap system-area-pointer)
+ (protect-p sb!alien:int))
+(defun protect-control-stack-guard-page (n)
+ (%protect-control-stack-guard-page
+ (sb!thread::thread-%sap sb!thread:*current-thread*) (if n 1 0)))