httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51358] New: Code clean up (use apr_table_(set|add|merge)n variant when possible) #2
Date Sat, 11 Jun 2011 05:43:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51358

             Bug #: 51358
           Summary: Code clean up (use apr_table_(set|add|merge)n variant
                    when possible) #2
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: All
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: christophe.jaillet@wanadoo.fr
    Classification: Unclassified


Created attachment 27145
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27145
Proposed patch

Hi,

following r51357, here are less trivial apr_table_(set|add|merge) -->
apr_table_(set|add|merge)n conversion.

The goal here is the same, avoid memory allocation when it can be safely
avoided.


It modifies the function calls when both the key and the value are constant
strings or allocated from the *same* memory pool and *not* used for any
purpose. 

This is, IMO, always safe to do the transformation in this case.

Modified files are :
   - modules/proxy/mod_proxy.c ('r->pool' and the pool referenced in
'r->headers_in' are the same)
   - modules/aaa/mod_auth_form.c (idem)
   - modules/ssl/ssl_engine_kernel.c (idem, even if more complex)

   - modules/proxy/mod_proxy_ftp.c (the pool 'p' and the pool referenced in
'r->headers_out' are the same. See definition of 'p' at the beginning of the
function)
   - modules/dav/main/mod_dav.c (idem, even if a bit more complex)

   - modules/mappers/mod_rewrite.c ('r->pool' and the pool referenced in
'r->notes' are the same)


Best regards

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message