Commit c69ebc13 authored by Stas Boukarev's avatar Stas Boukarev
Browse files

copy-mem: Don't touch more memory than needed.

parent 480ad121
......@@ -121,9 +121,14 @@
(declaim (inline copy-mem))
(defun copy-mem (from to length)
(loop for i below length by sb-vm:n-word-bytes
do (setf (sb-sys:sap-ref-word to i)
(sb-sys:sap-ref-word from i))))
(multiple-value-bind (words rest) (truncate length sb-vm:n-word-bytes)
(loop repeat words
for i by sb-vm:n-word-bytes
do (setf (sb-sys:sap-ref-word to i)
(sb-sys:sap-ref-word from i)))
(loop for i from (- length rest) below length
do (setf (sb-sys:sap-ref-8 to i)
(sb-sys:sap-ref-8 from i)))))
(declaim (inline read-ascii-string-optimized))
(defun read-ascii-string-optimized (length string stream)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment