X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fstream.lisp;h=88b2f987018999e01aa8d7d58da1d66988e05778;hb=2419deec84b45d81610dc8d3db610c3e2f7b9486;hp=adec88826d846588073f9fd1df17fb0002aec477;hpb=35871544d182adf1895cf6d99d3f995ac2b425e0;p=sbcl.git diff --git a/src/code/stream.lisp b/src/code/stream.lisp index adec888..88b2f98 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -150,6 +150,8 @@ (declare (type stream stream)) (declare (type (or index (alien sb!unix:off-t) (member nil :start :end)) position)) + ;; FIXME: It woud be good to comment on the stuff that is done here... + ;; FIXME: This doesn't look interrupt safe. (cond (position (setf (ansi-stream-in-index stream) +ansi-stream-in-buffer-length+) @@ -1134,14 +1136,14 @@ (truly-the index (+ index copy))) ;; FIXME: why are we VECTOR-SAP'ing things here? what's the point? ;; and are there SB-UNICODE issues here as well? --njf, 2005-03-24 - (without-gcing - (system-area-ub8-copy (vector-sap string) - index - (if (typep buffer 'system-area-pointer) - buffer - (vector-sap buffer)) - start - copy))) + (with-pinned-objects (string buffer) + (system-area-ub8-copy (vector-sap string) + index + (if (typep buffer 'system-area-pointer) + buffer + (vector-sap buffer)) + start + copy))) (if (and (> requested copy) eof-error-p) (error 'end-of-file :stream stream) copy))) @@ -1225,8 +1227,8 @@ ;; Global location in the stream (index 0 :type index) ;; Index cache: when we move backwards we save the greater of this - ;; and index here, so the the greater of index and this is always - ;; the end of the stream. + ;; and index here, so the greater of index and this is always the + ;; end of the stream. (index-cache 0 :type index) ;; Requested element type (element-type 'character)) @@ -2056,7 +2058,7 @@ benefit of the function GET-OUTPUT-STREAM-STRING.") (funcall write-function stream (aref data i)))))) (if (and (fd-stream-p stream) (compatible-vector-and-stream-element-types-p data stream)) - (output-raw-bytes stream data offset-start offset-end) + (buffer-output stream data offset-start offset-end) (output-seq-in-loop))))))) seq)