apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <i...@cnet.com>
Subject Re: [PATCH] optimization for apr_pool_userdata_set
Date Fri, 23 Nov 2001 17:03:47 GMT
On Thu, 2001-11-22 at 01:03, Brian Pane wrote:
> This patch takes advantage of the recent optimizations to
> apr_hash_t's handling of APR_HASH_KEY_STRING to eliminate
> a strlen call within apr_pool_userdata_set.
> 
your patch seems to patch apr_pool_userdata_setn not 
apr_pool_userdata_set

I've commited the below also applying the same thing to _set

..Ian
> --Brian
> 
> Index: srclib/apr/memory/unix/apr_pools.c
> ===================================================================
> RCS file: /home/cvspublic/apr/memory/unix/apr_pools.c,v
> retrieving revision 1.116
> diff -u -r1.116 apr_pools.c
> --- srclib/apr/memory/unix/apr_pools.c    2001/11/21 16:40:54    1.116
> +++ srclib/apr/memory/unix/apr_pools.c    2001/11/22 08:48:27
> @@ -1294,12 +1294,10 @@
>         apr_status_t (*cleanup) (void *),
>         apr_pool_t *cont)
>  {
> -    apr_size_t keylen = strlen(key);
> -
>      if (cont->prog_data == NULL)
>          cont->prog_data = apr_hash_make(cont);
>  
> -    apr_hash_set(cont->prog_data, key, keylen, data);
> +    apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data);
>  
>      if (cleanup) {
>          apr_pool_cleanup_register(cont, data, cleanup, cleanup);
> 
> 
-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 344-2608


Mime
View raw message