Bug 52350

Summary: Code clean up (apr_strings.c)
Product: APR Reporter: Christophe JAILLET <christophe.jaillet>
Component: APRAssignee: Apache Portable Runtime bugs mailinglist <bugs>
Status: RESOLVED WONTFIX    
Severity: enhancement Keywords: PatchAvailable
Priority: P2    
Version: HEAD   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Attachments: Proposed patch

Description Christophe JAILLET 2011-12-17 07:14:29 UTC
Created attachment 28081 [details]
Proposed patch

Hi,

in strings/apr_strings.c, most functions allocate its own memory when needed except 'apr_pstrdup' which actually call 'apr_pmemdup' for that.

This patch inlines this call in order to be more consistent with-in the code.
This also removes a small calling overhead in case the compiler does not inline the function by itself.

Hoping this helps.
Comment 1 Rainer Jung 2013-04-28 08:42:06 UTC
This is only true in trunk.
There the change was introduced by Jeff in r1089438:

change apr_palloc+memcpy to apr_pmemdup

PR: 47776
Submitted by: Boya Sun <boya.sun case.edu>
Comment 2 Christophe JAILLET 2014-09-18 20:08:56 UTC
Useless