Re: [PHP-DEV] str_repeat() patch

2004-06-13 Thread Michael Walter
Stefan Esser wrote: The whole discussion about memcpy beeing faster than memmove is completely pointless. [..] Agreed. Cheers, Michael -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] str_repeat() patch

2004-06-13 Thread Stefan Esser
Michael Walter wrote: Well, surely memmove() needs an additional branch to check for overlapping, though (the OP was wrong in that memmove() would need a temporary buffer, though - it doesn't, it usually copies from high addres to low in the overlapping case). The whole discussion about memcpy b

Re: [PHP-DEV] str_repeat() patch

2004-06-13 Thread Michael Walter
Well, surely memmove() needs an additional branch to check for overlapping, though (the OP was wrong in that memmove() would need a temporary buffer, though - it doesn't, it usually copies from high addres to low in the overlapping case). Cheers, Michael George Schlossnagle wrote: On Jun 12, 20

Re: [PHP-DEV] str_repeat() patch

2004-06-12 Thread George Schlossnagle
On Jun 12, 2004, at 10:27 AM, Alexander Valyalkin wrote: On Fri, 11 Jun 2004 17:00:03 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]> wrote: On Fri, 11 Jun 2004, Alexander Valyalkin wrote: Read it: void *memmove(void *s1, const void *s2, size_t n); If s1 and s2 overlap, all bytes are copied in a

Re: [PHP-DEV] str_repeat() patch

2004-06-12 Thread Alexander Valyalkin
On Fri, 11 Jun 2004 10:55:20 -0400, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: Read your memcpy manpages "The memcpy() function copies n bytes from memory area src to memory area dest. The memory areas may not overlap." Well, I've read my manpages: The memcpy() function copies n bytes

Re: [PHP-DEV] str_repeat() patch

2004-06-12 Thread Alexander Valyalkin
On Fri, 11 Jun 2004 17:00:03 +0200 (CEST), Derick Rethans <[EMAIL PROTECTED]> wrote: On Fri, 11 Jun 2004, Alexander Valyalkin wrote: Read it: void *memmove(void *s1, const void *s2, size_t n); If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike memcpy()) And anwer the qu

Re: [PHP-DEV] str_repeat() patch

2004-06-11 Thread Derick Rethans
On Fri, 11 Jun 2004, Alexander Valyalkin wrote: > > Read it: > void *memmove(void *s1, const void *s2, size_t n); > If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike > memcpy()) > > And anwer the question: are s1 and s2 overlap in the str_repeat() ? > Why don't use memcpy()

Re: [PHP-DEV] str_repeat() patch

2004-06-11 Thread Ilia Alshanetsky
Read your memcpy manpages "The memcpy() function copies n bytes from memory area src to memory area dest. The memory areas may not overlap." Ilia On June 11, 2004 10:50 am, Alexander Valyalkin wrote: > Read it: > void *memmove(void *s1, const void *s2, size_t n); > If s1 and s2 overlap,

[PHP-DEV] str_repeat() patch

2004-06-11 Thread Alexander Valyalkin
Read it: void *memmove(void *s1, const void *s2, size_t n); If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike memcpy()) And anwer the question: are s1 and s2 overlap in the str_repeat() ? Why don't use memcpy() instead of memmove() ? ===cut= --- string