[slime-cvs] CVS slime

heller heller at common-lisp.net
Sat Mar 8 08:42:21 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv17641

Modified Files:
	ChangeLog slime.el 
Log Message:
Be GC friendlier when parsing net packets.

* slime.el (slime-net-read): Instead of consing a fresh string,
use narrow-to-region and read the packet out of the buffer.

--- /project/slime/cvsroot/slime/ChangeLog	2008/03/04 15:48:40	1.1311
+++ /project/slime/cvsroot/slime/ChangeLog	2008/03/08 08:42:21	1.1312
@@ -1,3 +1,10 @@
+2008-03-07  Helmut Eller  <heller at common-lisp.net>
+
+	Be GC friendlier when parsing net packets.
+
+	* slime.el (slime-net-read): Instead of consing a fresh string,
+	use narrow-to-region and read the packet out of the buffer.
+
 2008-03-04  Helmut Eller  <heller at common-lisp.net>
 
 	* test.sh: Updated for Emacs 23.
--- /project/slime/cvsroot/slime/slime.el	2008/03/02 15:10:18	1.915
+++ /project/slime/cvsroot/slime/slime.el	2008/03/08 08:42:21	1.916
@@ -1743,9 +1743,10 @@
          (start (+ 6 (point)))
          (end (+ start length)))
     (assert (plusp length))
-    (let ((string (buffer-substring-no-properties start end)))
-      (prog1 (read string)
-        (delete-region (point-min) end)))))
+    (prog1 (save-restriction
+             (narrow-to-region start end)
+             (read (current-buffer)))
+      (delete-region (point-min) end))))
 
 (defun slime-net-decode-length ()
   "Read a 24-bit hex-encoded integer from buffer."




More information about the slime-cvs mailing list