X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Falloc.lisp;h=c7b76f9e004a79292345b834030a00d6316f640c;hb=7f1e94ae961a198e00daf281eb1dc858e5b2dcc7;hp=4bdb9fea4f26799c80a07a39c40aff672616fbc2;hpb=65cccbb44b03207ce2fb73b29424a91a7d315189;p=sbcl.git diff --git a/src/code/alloc.lisp b/src/code/alloc.lisp index 4bdb9fe..c7b76f9 100644 --- a/src/code/alloc.lisp +++ b/src/code/alloc.lisp @@ -22,29 +22,25 @@ (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))) - (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 (ash *static-space-free-pointer* n-fixnum-tag-bits)) + (vector (logior pointer other-pointer-lowtag)) + ;; rounded to dual word boundary + (nwords (logandc2 (+ lowtag-mask (+ words vector-data-offset 1)) + lowtag-mask)) + (new-pointer (+ pointer (ash nwords word-shift)))) + (when (> static-space-end new-pointer) + (store-word widetag + vector 0 other-pointer-lowtag) + (store-word (fixnumize length) + vector vector-length-slot other-pointer-lowtag) + (store-word 0 new-pointer) + (setf *static-space-free-pointer* + (ash new-pointer (- n-fixnum-tag-bits))) + (%make-lisp-obj vector)))) + (error 'simple-storage-condition + :format-control "Not enough memory left in static space to ~ + allocate vector.")))