ianh 01/11/23 08:47:52 Modified: . CHANGES memory/unix apr_pools.c Log: Speed up apr_pool_userdata_set[n] by letting apr_hash_set/get figure out the string length Obtained from: Brain Pane Revision Changes Path 1.187 +4 -0 apr/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apr/CHANGES,v retrieving revision 1.186 retrieving revision 1.187 diff -u -r1.186 -r1.187 --- CHANGES 2001/11/21 17:00:50 1.186 +++ CHANGES 2001/11/23 16:47:52 1.187 @@ -1,4 +1,8 @@ Changes with APR b1 + *) Speed up apr_pool_userdata_set[n] by letting hash_set figure out + the strings length + [Brain Pane ] + *) New function apr_mmap_dup. This is called in the mmap_setaside [Brain Pane ] 1.117 +4 -8 apr/memory/unix/apr_pools.c Index: apr_pools.c =================================================================== RCS file: /home/cvs/apr/memory/unix/apr_pools.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -r1.116 -r1.117 --- apr_pools.c 2001/11/21 16:40:54 1.116 +++ apr_pools.c 2001/11/23 16:47:52 1.117 @@ -1271,17 +1271,15 @@ 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); - if (apr_hash_get(cont->prog_data, key, keylen) == NULL){ + if (apr_hash_get(cont->prog_data, key, APR_HASH_KEY_STRING) == NULL){ char *new_key = apr_pstrdup(cont, key); - apr_hash_set(cont->prog_data, new_key, keylen, data); + apr_hash_set(cont->prog_data, new_key, APR_HASH_KEY_STRING, data); } else { - apr_hash_set(cont->prog_data, key, keylen, data); + apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data); } if (cleanup) { @@ -1294,12 +1292,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);