Thread (15 messages) flat view 15 messages, 4 authors, 2003-07-07

RE: memmove broken

From: Joakim Tjernlund <hidden>
Date: 2003-07-04 08:32:50

Joakim Tjernlund writes:
quoted
I just tried to used memmove in zlib(zlib_inflate_fast) to avoid expensive
byte copies. That didn't work and the reason is that the ppc memmove can handle
overlapping memory it seems.
I assume you mean "can't handle"?
Yes :)
If so, this is interesting because it is supposed to work. :)
quoted
memmove(dst, dst-x, n) where x is between 1 and 39, n >= x will cause corruption for me.
Gack.  It should be using backwards_memcpy in arch/ppc/lib/string.S.
I'll have to take a look at it.
Paul,
I just realized that there is something strange going on in zlib.
zlib_inflate_fast() does a standard byte copy:
do{
  *q++ = *r++;
while(--c); /* c >= 3 */

q is always greater than r and this works. This is something else than a
regular mem copy. I havn't figured out yet what is happening here but I don't
think there is a problem with backwards_memcpy()

    Jocke


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help