1.0.17.17: Add a conservative GC workaround to string-output-streams
authorJuho Snellman <jsnell@iki.fi>
Mon, 2 Jun 2008 03:17:15 +0000 (03:17 +0000)
committerJuho Snellman <jsnell@iki.fi>
Mon, 2 Jun 2008 03:17:15 +0000 (03:17 +0000)
        * Fill the lists of buffer pointers with NIL after producing
          the string. This reduces the likelyhood of the conservative
          GC hanging on to all of the buffers at once.

src/code/stream.lisp
version.lisp-expr

index 740f91a..14647db 100644 (file)
@@ -1532,14 +1532,20 @@ benefit of the function GET-OUTPUT-STREAM-STRING.")
     (flet ((replace-all (fun)
              (let ((start 0))
                (declare (index start))
-               (dolist (buffer (nreverse prev))
+               (setf prev (nreverse prev))
+               (dolist (buffer prev)
                  (funcall fun buffer start)
                  (incf start (length buffer)))
                (funcall fun this start)
                (incf start (length this))
                (dolist (buffer next)
                  (funcall fun buffer start)
-                 (incf start (length buffer))))))
+                 (incf start (length buffer)))
+               ;; Hack: erase the pointers to strings, to make it less
+               ;; likely that the conservative GC will accidentally
+               ;; retain the buffers.
+               (fill prev nil)
+               (fill next nil))))
       (macrolet ((frob (type)
                    `(replace-all (lambda (buffer from)
                                    (declare (type ,type result)
index 9355972..bb50474 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.17.16"
+"1.0.17.17"