Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vladimir Sedach
storage
Commits
cdd4c29d
Commit
cdd4c29d
authored
Feb 18, 2012
by
Stas Boukarev
Browse files
Optimize copy-mem.
parent
c69ebc13
Changes
1
Hide whitespace changes
Inline
Side-by-side
io-sbcl.lisp
View file @
cdd4c29d
...
@@ -121,18 +121,18 @@
...
@@ -121,18 +121,18 @@
(
declaim
(
inline
copy-mem
))
(
declaim
(
inline
copy-mem
))
(
defun
copy-mem
(
from
to
length
)
(
defun
copy-mem
(
from
to
length
)
(
multiple-value-bind
(
words
rest
)
(
truncate
length
sb-vm:n-word-bytes
)
(
let
((
words-end
(
-
length
(
rem
length
sb-vm:n-word-bytes
))))
(
loop
repeat
words
(
loop
for
i
by
sb-vm:n-word-bytes
below
words-end
for
i
by
sb-vm:n-word-bytes
do
(
setf
(
sb-sys:sap-ref-word
to
i
)
do
(
setf
(
sb-sys:sap-ref-word
to
i
)
(
sb-sys:sap-ref-word
from
i
)))
(
sb-sys:sap-ref-word
from
i
)))
(
loop
for
i
from
(
-
length
rest
)
below
length
(
loop
for
i
from
words-end
below
length
do
(
setf
(
sb-sys:sap-ref-8
to
i
)
do
(
setf
(
sb-sys:sap-ref-8
to
i
)
(
sb-sys:sap-ref-8
from
i
)))))
(
sb-sys:sap-ref-8
from
i
)))))
(
declaim
(
inline
read-ascii-string-optimized
))
(
declaim
(
inline
read-ascii-string-optimized
))
(
defun
read-ascii-string-optimized
(
length
string
stream
)
(
defun
read-ascii-string-optimized
(
length
string
stream
)
(
declare
(
type
fixnum
length
))
(
declare
(
type
fixnum
length
)
(
optimize
speed
))
(
sb-sys:with-pinned-objects
(
string
)
(
sb-sys:with-pinned-objects
(
string
)
(
let
((
mmap-sap
(
advance-stream
length
stream
))
(
let
((
mmap-sap
(
advance-stream
length
stream
))
(
string-sap
(
sb-sys:vector-sap
string
)))
(
string-sap
(
sb-sys:vector-sap
string
)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment