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

Re: dynamic-extent & objects



> Date: Thu, 12 Mar 1992 10:47:42 -0500
> From: derek@cambridge.apple.com
> 
> Does the (declare (dynamic-extent x)) change anything?
> 
> (let ((x (make-instance 'mac-buffer-stream :data-buffer-size 0)))
>   (declare (dynamic-extent x))
>   ...
>   )

It grants permission to allocate the mac-buffer-stream instance on the
stack instead of in the heap.  Disassembly of an example shows that MCL
does not currently take advantage of that permission, at least not for
this particular test case.  Since ... is not a valid token, the actual test
case that I used was:

  (defun foo ()
    (let ((x (make-instance 'mac-buffer-stream :data-buffer-size 0)))
      (declare (dynamic-extent x))
      (print x)
      t))