From 2de7a2c9085685b5891eac6516057c09f7e331da Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Mon, 2 Jun 2008 03:17:15 +0000 Subject: [PATCH] 1.0.17.17: Add a conservative GC workaround to string-output-streams * 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 | 10 ++++++++-- version.lisp-expr | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/code/stream.lisp b/src/code/stream.lisp index 740f91a6e..14647db1b 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -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) diff --git a/version.lisp-expr b/version.lisp-expr index 9355972cb..bb50474a2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 2.11.4.GIT