Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10411 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60809 invoked by uid 1010); 12 Jun 2004 16:56:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 60759 invoked from network); 12 Jun 2004 16:56:25 -0000 Received: from unknown (HELO longsword) (66.80.117.3) by pb1.pair.com with SMTP; 12 Jun 2004 16:56:25 -0000 Received: from ([66.80.117.254:28975]) by mail.omniti.com (ecelerity HEAD) with SMTP id 6C/A2-32384-7B53BC04; Sat, 12 Jun 2004 12:56:25 -0400 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v618) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: internals@lists.php.net Date: Sat, 12 Jun 2004 12:58:46 -0400 To: "Alexander Valyalkin" X-Mailer: Apple Mail (2.618) Subject: Re: [PHP-DEV] str_repeat() patch From: george@omniti.com (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 > 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 question: are s1 and s2 overlap in the str_repeat() ? >>> Why don't use memcpy() instead of memmove() ? >> >> Because it's slower and we're copying to newly allocated memory anyway >> so things CAN not overlap. Also, your patch is the wrong way around. >> > > Mybe I'm mistaken, but I think, that memmove() looks like that (without > any error checks): That's not what my glibc sources look like. George