[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

array with dynamic-extent



Hello,

I am trying to performance-tune an MCL app.
I'd like to use an adjustable vector having dynamic-extent:

(defun foo (args)
  (let ((vec (make-array '(100) :adjustable t)))
    (declare (dynamic-extent vec))
    -- blah blah blah --
    (dolist (arg ags)
      (vector-puch-extend (bar arg) vec))
    -- blah blah blah --
    ))

If the vector needs extension, fine, allocate a larger vector from the heap and
I'll live with the consequences, but if no extension is required, let the
vector
live in peace on the stack.

Problem is, CLtL2 says that unless the size of an object is lexically apparent
at the time of compilation, a dynamic-extent declaration is probably going to
be ignored, and that appears to be the case above in the experiments I've done.

Main question: Is there a way to make an adjustable vector with dynamic
extent?

Minor question: What is MCL's algorithm governing the size of the extension
used in < vector-push-extend > when the programmer does not supply an
extension size?

Thanks in advance,

John
sotos@welchlink.welch.jhu.edu