Ignore:
Timestamp:
Jul 17, 2009, 10:05:20 AM (10 years ago)
Author:
gb
Message:

(Greatly) increase the value of $LISTENER-FLUSH-LIMIT; keep its value
as of stream-creation time in a slot in COCOA-LISTENER-OUTPUT-STREAMs
(to make changing the limit at runtime a little more thread-safe, maybe.)
(Ticket:558).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-listener.lisp

    r12320 r12423  
    152152      (setf (hi:input-stream-reading-line stream) old-reading-line))))
    153153
    154 (defparameter $listener-flush-limit 100)
     154(defparameter $listener-flush-limit 4095)
    155155
    156156(defclass cocoa-listener-output-stream (fundamental-character-output-stream)
     
    159159   (data :initform (make-array (1+ $listener-flush-limit)
    160160                               :adjustable t :fill-pointer 0
    161                                :element-type 'character))))
     161                               :element-type 'character))
     162   (limit :initform $listener-flush-limit)))
    162163
    163164(defmethod stream-element-type ((stream cocoa-listener-output-stream))
     
    166167
    167168(defmethod ccl:stream-write-char ((stream cocoa-listener-output-stream) char)
    168   (with-slots (data lock) stream
     169  (with-slots (data lock limit) stream
    169170    (when (with-lock-grabbed (lock)
    170             (>= (vector-push-extend char data) $listener-flush-limit))
     171            (>= (vector-push-extend char data) limit))
    171172      (stream-force-output stream))))
    172173
     
    189190
    190191(defmethod ccl:stream-fresh-line  ((stream cocoa-listener-output-stream))
    191   (with-slots (hemlock-view data lock) stream
     192  (with-slots (hemlock-view data lock limit) stream
    192193    (when (with-lock-grabbed (lock)
    193194            (let ((n (length data)))
     
    195196                        (= (hemlock-listener-output-mark-column hemlock-view) 0)
    196197                        (eq (aref data (1- n)) #\Newline))
    197                 (>= (vector-push-extend #\Newline data) $listener-flush-limit))))
     198                (>= (vector-push-extend #\Newline data) limit))))
    198199      (stream-force-output stream))))
    199200
Note: See TracChangeset for help on using the changeset viewer.