;;; so take care with this one...
(defmacro dx-let (bindings &body forms)
`(locally
- #-sb-xc-host
- (declare (optimize sb!c::stack-allocate-dynamic-extent))
+ (declare (optimize #-sb-xc-host sb!c::stack-allocate-dynamic-extent
+ #-sb-xc-host sb!c::stack-allocate-value-cells))
(let ,bindings
(declare (dynamic-extent ,@(mapcar (lambda (bind)
(if (consp bind)
;;; then fill the input buffer, and return the number of bytes read. Throws
;;; to EOF-INPUT-CATCHER if the eof was reached.
(defun refill-input-buffer (stream)
- (let ((fd (fd-stream-fd stream))
- (errno 0)
- (count 0))
- (declare (optimize sb!c::stack-allocate-value-cells)
- (dynamic-extent fd errno count))
+ (dx-let ((fd (fd-stream-fd stream))
+ (errno 0)
+ (count 0))
(tagbody
;; Check for blocking input before touching the stream, as if
;; we happen to wait we are liable to be interrupted, and the
(declare (function function))
(flet ((%call-with-system-mutex ()
(dx-let (got-it)
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(unwind-protect
(when (setf got-it (get-mutex mutex))
(funcall function))
(declare (function function))
(without-interrupts
(dx-let (got-it)
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(unwind-protect
(when (setf got-it (get-spinlock spinlock))
(funcall function))
(flet ((%call-with-system-spinlock ()
(dx-let ((inner-lock-p (eq *current-thread* (spinlock-value spinlock)))
(got-it nil))
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(unwind-protect
(when (or inner-lock-p (setf got-it (get-spinlock spinlock)))
(funcall function))
(defun call-with-spinlock (function spinlock)
(declare (function function))
(dx-let ((got-it nil))
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(without-interrupts
(unwind-protect
(when (setf got-it (allow-with-interrupts
(defun call-with-mutex (function mutex value waitp)
(declare (function function))
(dx-let ((got-it nil))
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(without-interrupts
(unwind-protect
(when (setq got-it (allow-with-interrupts
(declare (function function))
(dx-let ((inner-lock-p (eq (mutex-%owner mutex) *current-thread*))
(got-it nil))
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(without-interrupts
(unwind-protect
(when (or inner-lock-p (setf got-it (allow-with-interrupts
(declare (function function))
(dx-let ((inner-lock-p (eq (spinlock-value spinlock) *current-thread*))
(got-it nil))
- #-sb-xc-host (declare (optimize sb!c::stack-allocate-value-cells))
(without-interrupts
(unwind-protect
(when (or inner-lock-p (setf got-it (allow-with-interrupts