X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=byte-stream.lisp;h=e3036074a00034224864fd7b3dfcef8767a98ff8;hp=6e785fa2fa90d883ce1aca8ba3f784151f4fdf44;hb=b7f3a2b6318514a93a08c67254eb145e1a3a29e2;hpb=03712fbb06acbb103602bae10f41aeae7fa05127 diff --git a/byte-stream.lisp b/byte-stream.lisp index 6e785fa..e303607 100644 --- a/byte-stream.lisp +++ b/byte-stream.lisp @@ -241,21 +241,22 @@ Make-Byte-Array-Output-Stream since the last call to this function." (replace result (slot-value stream 'excl::buffer)) result)) - (defmethod excl:device-extend ((stream extendable-buffer-output-stream) - need action) - (declare (ignore action)) - (let* ((len (file-position stream)) - (new-len (max (+ len need) (* 2 len))) - (old-buf (slot-value stream 'excl::buffer)) - (new-buf (make-array new-len :element-type '(unsigned-byte 8)))) - (declare (fixnum len) - (optimize (speed 3) (safety 0))) - (dotimes (i len) - (setf (aref new-buf i) (aref old-buf i))) - (setf (slot-value stream 'excl::buffer) new-buf) - (setf (slot-value stream 'excl::buffer-ptr) new-len) - ) - t) + (excl::without-package-locks + (defmethod excl:device-extend ((stream extendable-buffer-output-stream) + need action) + (declare (ignore action)) + (let* ((len (file-position stream)) + (new-len (max (+ len need) (* 2 len))) + (old-buf (slot-value stream 'excl::buffer)) + (new-buf (make-array new-len :element-type '(unsigned-byte 8)))) + (declare (fixnum len) + (optimize (speed 3) (safety 0))) + (dotimes (i len) + (setf (aref new-buf i) (aref old-buf i))) + (setf (slot-value stream 'excl::buffer) new-buf) + (setf (slot-value stream 'excl::buffer-ptr) new-len) + ) + t)) )