X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Falloc.lisp;h=e325f375ce5679fd10cf818be7842071ae47022b;hb=6ddaf294e5a7e3b1792ed1d9c342894c38538773;hp=866a9ee7abc7bf99582924e6420df76b03052889;hpb=9b55754d5328a5f44ee224d32865fc8dadee123b;p=sbcl.git diff --git a/src/code/alloc.lisp b/src/code/alloc.lisp index 866a9ee..e325f37 100644 --- a/src/code/alloc.lisp +++ b/src/code/alloc.lisp @@ -15,40 +15,39 @@ #!-sb-fluid (declaim (inline store-word)) (defun store-word (word base &optional (offset 0) (lowtag 0)) (declare (type (unsigned-byte #.sb!vm:n-word-bits) word base offset) - (type (unsigned-byte #.n-lowtag-bits) lowtag)) + (type (unsigned-byte #.n-lowtag-bits) lowtag)) (setf (sap-ref-word (int-sap base) (- (ash offset word-shift) lowtag)) word)) (defun allocate-static-vector (widetag length words) (declare (type (unsigned-byte #.n-widetag-bits) widetag) - (type (unsigned-byte #.n-word-bits) words) - (type index length)) + (type (unsigned-byte #.n-word-bits) words) + (type index length)) (handler-case ;; FIXME: Is WITHOUT-GCING enough to do lisp-side allocation ;; to static space, or should we have WITHOUT-INTERRUPTS here ;; as well? (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 ~ + (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) - (prog1 - (make-lisp-obj vector) - (setf *static-space-free-pointer* new-pointer)))) + (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) + (prog1 + (make-lisp-obj vector) + (setf *static-space-free-pointer* new-pointer)))) (serious-condition (c) ;; unwind from WITHOUT-GCING (error c)))) - \ No newline at end of file