Changeset 10217


Ignore:
Timestamp:
Jul 27, 2008, 4:29:39 PM (11 years ago)
Author:
gb
Message:

Don't use *pname-buffer* (not thread-safe/thread-private) in WRITE-PNAME;
use a stack-allocated string instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-io.lisp

    r10141 r10217  
    996996
    997997
    998 (defvar *pname-buffer* (%cons-pool "12345678901234567890"))
    999998
    1000999(defun write-pname (name case stream)
     
    10751074            (let* ((outbuf-len (+ len len))
    10761075                   (outbuf-ptr -1)
    1077                    (pool *pname-buffer*)
    1078                    (outbuf (pool.data pool)))
    1079               (declare (fixnum outbuf-ptr) (simple-string outbuf))
    1080               (setf (pool.data pool) nil)   ; grab it.
    1081               (unless (and outbuf (>= (length outbuf) outbuf-len))
    1082                 (setq outbuf (make-array outbuf-len :element-type 'character)))
     1076                   (outbuf (make-string outbuf-len)))
     1077              (declare (fixnum outbuf-ptr outbuf-len)
     1078                       (dynamic-extent outbuf)
     1079                       (simple-string outbuf))
    10831080              (dotimes (pos (the fixnum len))
    10841081                (declare (type fixnum pos))
     
    10951092                    (setf (schar outbuf (incf outbuf-ptr)) #\\))
    10961093                  (setf (schar outbuf (incf outbuf-ptr)) char)))
    1097               (write-string outbuf stream :start  0 :end (1+ outbuf-ptr))
    1098               (setf (pool.data pool) outbuf)))))))
     1094              (write-string outbuf stream :start  0 :end (1+ outbuf-ptr))))))))
    10991095
    11001096#|
Note: See TracChangeset for help on using the changeset viewer.