X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=byte-stream.lisp;h=0021022e8f78c6ec5aab769a79f946f4fe47b3b1;hb=d98ff150815e427ae475303fbd09e734cb345cb7;hp=6e785fa2fa90d883ce1aca8ba3f784151f4fdf44;hpb=03712fbb06acbb103602bae10f41aeae7fa05127;p=kmrcl.git diff --git a/byte-stream.lisp b/byte-stream.lisp index 6e785fa..0021022 100644 --- a/byte-stream.lisp +++ b/byte-stream.lisp @@ -1,4 +1,4 @@ -;;; -*- Syntax: Ansi-Common-Lisp; Base: 10; Mode: lisp; Package: kmrcl -*- +;;; -*- Syntax: Ansi-Common-Lisp; Base: 10; Mode: lisp -*- ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; @@ -7,8 +7,6 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: June 2003 ;;;; -;;;; $Id$ -;;;; ;;;; Works for CMUCL, SBCL, and AllergoCL only ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2003 by Kevin M. Rosenberg @@ -21,7 +19,7 @@ (in-package #:kmrcl) -;; Intial CMUCL version by OnShored. Ported to SBCL by Kevin Rosenberg +;; Intial CMUCL version by OnShored. Ported to AllegroCL, SBCL by Kevin Rosenberg #+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) @@ -241,21 +239,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)) )