From 1d1b62b36b0a4730f9501179c06c74dd14d2ad27 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Wed, 5 Nov 2014 21:17:03 -0500 Subject: [PATCH] Full call to VECTOR shouldn't cons both a list and a vector. And BIT array accessors should not cons. --- src/code/array.lisp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/code/array.lisp b/src/code/array.lisp index 95e049e5b..8a741492e 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -536,7 +536,9 @@ of specialized arrays is supported." (defun vector (&rest objects) #!+sb-doc "Construct a SIMPLE-VECTOR from the given objects." - (coerce (the list objects) 'simple-vector)) + (let ((v (make-array (length objects)))) + (do-rest-arg ((x i) objects 0 v) + (setf (aref v i) x)))) ;;;; accessor/setter functions @@ -828,12 +830,14 @@ of specialized arrays is supported." #!+sb-doc "Return the bit from the BIT-ARRAY at the specified SUBSCRIPTS." (declare (type (array bit) bit-array) + (truly-dynamic-extent subscripts) (optimize (safety 1))) (row-major-aref bit-array (%array-row-major-index bit-array subscripts))) (defun (setf bit) (new-value bit-array &rest subscripts) (declare (type (array bit) bit-array) (type bit new-value) + (truly-dynamic-extent subscripts) (optimize (safety 1))) (setf (row-major-aref bit-array (%array-row-major-index bit-array subscripts)) @@ -843,6 +847,7 @@ of specialized arrays is supported." #!+sb-doc "Return the bit from SIMPLE-BIT-ARRAY at the specified SUBSCRIPTS." (declare (type (simple-array bit) simple-bit-array) + (truly-dynamic-extent subscripts) (optimize (safety 1))) (row-major-aref simple-bit-array (%array-row-major-index simple-bit-array subscripts))) @@ -850,6 +855,7 @@ of specialized arrays is supported." (defun (setf sbit) (new-value bit-array &rest subscripts) (declare (type (simple-array bit) bit-array) (type bit new-value) + (truly-dynamic-extent subscripts) (optimize (safety 1))) (setf (row-major-aref bit-array (%array-row-major-index bit-array subscripts)) -- 2.11.4.GIT