X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Falloc.lisp;h=fa25d4e1b3f58712f474c7167fc5d5e7c92a8f24;hb=a160917364f85b38dc0826a5e3dcef87e3c4c62c;hp=5ae0275672b9f66d9e775bf1c2098719a7a3eee6;hpb=dc9fb9111cb1b645aaede0d3ec019c0f78200be0;p=sbcl.git diff --git a/src/code/alloc.lisp b/src/code/alloc.lisp index 5ae0275..fa25d4e 100644 --- a/src/code/alloc.lisp +++ b/src/code/alloc.lisp @@ -22,31 +22,26 @@ (declare (type (unsigned-byte #.n-widetag-bits) widetag) (type (unsigned-byte #.n-word-bits) words) (type index length)) - (handler-case - ;; WITHOUT-GCING implies WITHOUT-INTERRUPTS - (without-gcing - (let* ((pointer *static-space-free-pointer*) ; in words - (free (* pointer n-word-bytes)) - (vector (logior free other-pointer-lowtag)) ; in bytes, yay - ;; rounded to dual word boundary - (nwords (logandc2 (+ lowtag-mask (+ words vector-data-offset 1)) - lowtag-mask)) - (new-pointer (+ *static-space-free-pointer* nwords)) - (new-free (* new-pointer n-word-bytes))) - ;; FIXME: don't signal while in WITHOUT-GCING, the handler - ;; risks deadlock with SIG_STOP_FOR_GC. - (unless (> static-space-end new-free) - (error 'simple-storage-condition - :format-control "Not enough memory left in static space to ~ - allocate vector.")) - (store-word widetag - vector 0 other-pointer-lowtag) - (store-word (ash length word-shift) - vector vector-length-slot other-pointer-lowtag) - (store-word 0 new-free) - (setf *static-space-free-pointer* new-pointer) - (%make-lisp-obj vector))) - (serious-condition (c) - ;; unwind from WITHOUT-GCING - (error c)))) + ;; WITHOUT-GCING implies WITHOUT-INTERRUPTS + (or + (without-gcing + (let* ((pointer *static-space-free-pointer*) ; in words + (free (* pointer n-word-bytes)) + (vector (logior free other-pointer-lowtag)) ; in bytes, yay + ;; rounded to dual word boundary + (nwords (logandc2 (+ lowtag-mask (+ words vector-data-offset 1)) + lowtag-mask)) + (new-pointer (+ *static-space-free-pointer* nwords)) + (new-free (* new-pointer n-word-bytes))) + (when (> static-space-end new-free) + (store-word widetag + vector 0 other-pointer-lowtag) + (store-word (ash length word-shift) + vector vector-length-slot other-pointer-lowtag) + (store-word 0 new-free) + (setf *static-space-free-pointer* new-pointer) + (%make-lisp-obj vector)))) + (error 'simple-storage-condition + :format-control "Not enough memory left in static space to ~ + allocate vector.")))