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 51357] New: Code clean up (use apr_table_(set|add|merge)n variant when possible)
Date Sat, 11 Jun 2011 04:36:48 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51357

             Bug #: 51357
           Summary: Code clean up (use apr_table_(set|add|merge)n variant
                    when possible)
           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 27144
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27144
Proposed patch

Hi,

function apr_table_(set|add|merge) have some variants that do *not* duplicate
strings. It can be safely used if you can "ensure that the values will not
change after they have been added."

When usable, it saves some memory allocation.

These variants are apr_table_(set|add|merge)n functions.


The proposed patch is trivial. It only modifies the function calls when both
the key and the value are constant strings. This is always safe to do the
transformation in this case.

Other patches will be proposed when 1 or both strings are already duplicated in
a memory pool and *not* used for another purpose. These other patches will
require more careful checking. 


For now modified files are :
   - modules/http/http_filters.c
   - modules/proxy/proxy_util.c
   - modules/ssl/ssl_engine_io.c
   - modules/cache/cache_util.c
   - modules/arch/netware/mod_netware.c
   - modules/arch/netware/mod_nw_ssl.c

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