X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Farray.lisp;h=a3c6793066407521329670cd97939a9104d237a3;hb=dcb73f3edef1e31078fbe585e2fafbd26743efd7;hp=d1e06bbc9441e139ea6a3169bd274345e772118a;hpb=8ef3aa533aba5ac5760e83b798cd6b2388a807a6;p=sbcl.git diff --git a/src/code/array.lisp b/src/code/array.lisp index d1e06bb..a3c6793 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -944,11 +944,13 @@ of specialized arrays is supported." (defun shrink-vector (vector new-length) (declare (vector vector)) - (cond ((eq (length vector) new-length) - vector) - ((array-has-fill-pointer-p vector) - (setf (%array-fill-pointer vector) new-length)) - (t (subseq vector 0 new-length)))) + (cond + ((eq (length vector) new-length) + vector) + ((array-has-fill-pointer-p vector) + (setf (%array-fill-pointer vector) new-length) + vector) + (t (subseq vector 0 new-length)))) ;;; Fill in array header with the provided information, and return the array. (defun set-array-header (array data length fill-pointer displacement dimensions @@ -973,7 +975,13 @@ of specialized arrays is supported." ;;;; ZAP-ARRAY-DATA for ADJUST-ARRAY ;;; a temporary to be used when OLD-DATA and NEW-DATA are EQ. -;;; KLUDGE: Boy, DYNAMIC-EXTENT would be nice. +;;; KLUDGE: Boy, DYNAMIC-EXTENT would be nice. This is rebound +;;; to length zero array in each new thread. +;;; +;;; DX is probably a bad idea, because a with a big array it would +;;; be fairly easy to blow the stack. +;;; +;;; Rebound per thread. (defvar *zap-array-data-temp* (make-array 1000 :initial-element t)) (defun zap-array-data-temp (length element-type initial-element