changelog shortlog graph tags branches changeset file revisions annotate raw help

Mercurial > core / lisp/lib/io/fast.lisp

revision 695: 2bad47888dbf
parent 690: 90417ae14b21
     1.1--- a/lisp/lib/io/fast.lisp	Thu Oct 03 21:54:07 2024 -0400
     1.2+++ b/lisp/lib/io/fast.lisp	Fri Oct 04 16:14:44 2024 -0400
     1.3@@ -47,9 +47,10 @@
     1.4              (type octet-vector vec)
     1.5              (type non-negative-fixnum pos vec-len new-pos))
     1.6     ;; Only need to update if pos or new-pos is in stream range.
     1.7-    (when-let ((stream-update-needed? (or (> pos vec-len)
     1.8-                                          (> new-pos vec-len)))
     1.9-               (stream (input-buffer-stream buffer)))
    1.10+    (when-let ((stream (and
    1.11+                        (or (> pos vec-len)
    1.12+                            (> new-pos vec-len))
    1.13+                        (input-buffer-stream buffer))))
    1.14       (let* ((stream-file-pos (file-position stream))
    1.15              (pos-diff (- new-pos pos))
    1.16              (stream-diff (cond ((and (> pos vec-len)
    1.17@@ -78,12 +79,9 @@
    1.18 (defun concat-buffer (buffer)
    1.19   (let* ((len (output-buffer-len buffer))
    1.20          (array
    1.21-           #+fast-io-sv
    1.22            (if (eq :static (output-buffer-output buffer))
    1.23-               (static-vectors:make-static-vector (the array-index len))
    1.24-               (make-octet-vector len))
    1.25-           #-fast-io-sv
    1.26-           (make-octet-vector len)))
    1.27+               (make-static-vector (the array-index len))
    1.28+               (make-octet-vector len))))
    1.29     (loop as i = 0 then (+ i (length a))
    1.30           for a in (output-buffer-queue buffer) do
    1.31             (replace (the octet-vector array)
    1.32@@ -369,7 +367,7 @@
    1.33 
    1.34 ;; fast-stream
    1.35 
    1.36-(defclass fast-io-stream (fundamental-stream)
    1.37+(defclass fast-io-stream (sb-gray:fundamental-stream)
    1.38   ((openp :type boolean :initform t)))
    1.39 
    1.40 (defmethod stream-file-position ((stream fast-io-stream))
    1.41@@ -381,7 +379,7 @@
    1.42 
    1.43  ;; fast-output-stream
    1.44 
    1.45-(defclass fast-output-stream (fast-io-stream fundamental-output-stream)
    1.46+(defclass fast-output-stream (fast-io-stream sb-gray:fundamental-output-stream)
    1.47   ((buffer :type output-buffer)))
    1.48 
    1.49 (defmethod initialize-instance ((self fast-output-stream) &key stream
    1.50@@ -424,7 +422,7 @@
    1.51 
    1.52  ;; fast-input-stream
    1.53 
    1.54-(defclass fast-input-stream (fast-io-stream fundamental-input-stream)
    1.55+(defclass fast-input-stream (fast-io-stream sb-gray:fundamental-input-stream)
    1.56   ((buffer :type input-buffer)))
    1.57 
    1.58 (defmethod initialize-instance ((self fast-input-stream) &key stream