X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=byte-stream.lisp;h=05059a023739cc45006fee7ce5f0c27f1d691ebd;hp=6e785fa2fa90d883ce1aca8ba3f784151f4fdf44;hb=HEAD;hpb=03712fbb06acbb103602bae10f41aeae7fa05127 diff --git a/byte-stream.lisp b/byte-stream.lisp index 6e785fa..05059a0 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) @@ -96,12 +94,12 @@ Make-Byte-Array-Output-Stream since the last call to this function." #+sbcl (eval-when (:compile-toplevel :load-toplevel :execute) (sb-ext:without-package-locks - (defvar *system-copy-fn* (if (fboundp (intern "COPY-SYSTEM-AREA" "SB-KERNEL")) - (intern "COPY-SYSTEM-AREA" "SB-KERNEL") - (intern "COPY-SYSTEM-UB8-AREA" "SB-KERNEL"))) - (defconstant +system-copy-multiplier+ (if (fboundp (intern "COPY-FROM-SYSTEM-AREA" "SB-KERNEL")) - sb-vm:n-byte-bits - 1)))) + (sb-ext:without-package-locks + (defvar *system-copy-fn* (intern "SYSTEM-AREA-UB8-COPY" "SB-KERNEL")) + (defconstant +system-copy-multiplier+ + (if (fboundp (intern "COPY-UB8-FROM-SYSTEM-AREA" "SB-KERNEL")) + sb-vm:n-byte-bits + 1))))) #+(or cmu sbcl) (progn @@ -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)) ) @@ -265,5 +264,3 @@ Make-Byte-Array-Output-Stream since the last call to this function." (end (length buffer))) (excl:make-buffer-input-stream buffer start end :octets)) ) ;; progn - -