From dev-return-24364-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Aug 8 22:55:39 2011 Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B4F78075 for ; Mon, 8 Aug 2011 22:55:39 +0000 (UTC) Received: (qmail 78833 invoked by uid 500); 8 Aug 2011 22:55:38 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 78737 invoked by uid 500); 8 Aug 2011 22:55:37 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 78729 invoked by uid 99); 8 Aug 2011 22:55:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 22:55:36 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of apr-dev@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Aug 2011 22:55:27 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QqYiv-0000YD-Pi for dev@apr.apache.org; Tue, 09 Aug 2011 00:55:05 +0200 Received: from aorleans-552-1-122-67.w92-140.abo.wanadoo.fr ([92.140.249.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Aug 2011 00:55:05 +0200 Received: from christophe.jaillet by aorleans-552-1-122-67.w92-140.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Aug 2011 00:55:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: dev@apr.apache.org From: "Christophe JAILLET" Subject: Speed up 'apr_pstrdup' Date: Tue, 9 Aug 2011 00:19:06 +0200 Lines: 27 Message-ID: X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: aorleans-552-1-122-67.w92-140.abo.wanadoo.fr X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Antivirus: avast! (VPS 110808-0, 08/08/2011), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Hi, 'apr_pstrdup' can be (if not already done by the compiler...) speed up a little by inlining the call to 'apr_pmemdup'. This avoid the overhead of calling a function and remove a redundant NULL check. A proposed, untested, patch is attached. Best regards, CJ begin 666 diff_apr2.patch M26YD97@Z('-T2D*0$ @+3