X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Farray.lisp;h=360514d03121d7a4e3cc46aafcf7e7e1e9696fe1;hb=422b88abf96f4842a3d0999cd3b80d96f5a153d6;hp=07707232d5fc4d3988bca52b994e882ed0234638;hpb=d75b4eb603f1e9e366997c8e378fe0ae0d79b5d9;p=sbcl.git diff --git a/src/code/array.lisp b/src/code/array.lisp index 0770723..360514d 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -49,6 +49,11 @@ (defun %with-array-data (array start end) (%with-array-data-macro array start end :fail-inline? t)) +(defun %data-vector-and-index (array index) + (if (array-header-p array) + (%with-array-data array index nil) + (values array index))) + ;;; It'd waste space to expand copies of error handling in every ;;; inline %WITH-ARRAY-DATA, so we have them call this function ;;; instead. This is just a wrapper which is known never to return. @@ -330,7 +335,7 @@ (defun hairy-data-vector-set (array index new-value) (with-array-data ((vector array) (index index) (end)) - (declare (ignore end) (optimize)) + (declare (ignore end)) (etypecase vector . #.(mapcar (lambda (type) (let ((atype `(simple-array ,type (*)))) @@ -338,7 +343,13 @@ (data-vector-set (the ,atype vector) index (the ,type - new-value))))) + new-value)) + ;; For specialized arrays, the return + ;; from data-vector-set would have to + ;; be reboxed to be a (Lisp) return + ;; value; instead, we use the + ;; already-boxed value as the return. + new-value))) *specialized-array-element-types*)))) (defun %array-row-major-index (array subscripts