Bug 52350 - Code clean up (apr_strings.c)
Summary: Code clean up (apr_strings.c)
Status: RESOLVED WONTFIX
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC Windows 2000
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2011-12-17 07:14 UTC by Christophe JAILLET
Modified: 2014-09-18 20:08 UTC (History)
0 users



Attachments
Proposed patch (371 bytes, patch)
2011-12-17 07:14 UTC, Christophe JAILLET
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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