httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
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

             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
    Classification: Unclassified

Created attachment 27144
Proposed patch


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:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message