diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2001-09-06 06:34:59 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2001-09-06 06:34:59 +0000 |
commit | abd18957b81b98d6aef424d0ed0347e084cc26b3 (patch) | |
tree | 2f22f344d064bf01929f5ddaba2e95145cf5562b /tables | |
parent | 1ac25f03d53df84c3cd82c3b5928a0c9bdd5d1b7 (diff) | |
download | libapr-abd18957b81b98d6aef424d0ed0347e084cc26b3.tar.gz |
The find_entry() function in apr_hash.c is responsible for over
half the apr_pcalloc() calls in the httpd. The calloc call
is somewhat wasteful in this context; 4 of the 5 fields in the
allocated struct get overwritten immediately. Thus the following
patch replaces the calloc with an alloc and sets the one necessary
field to NULL.
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Justin Erenkrantz
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62292 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r-- | tables/apr_hash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tables/apr_hash.c b/tables/apr_hash.c index 49e11f5ef..3e1678aeb 100644 --- a/tables/apr_hash.c +++ b/tables/apr_hash.c @@ -278,7 +278,8 @@ static apr_hash_entry_t **find_entry(apr_hash_t *ht, if (he || !val) return hep; /* add a new entry for non-NULL values */ - he = apr_pcalloc(ht->pool, sizeof(*he)); + he = apr_palloc(ht->pool, sizeof(*he)); + he->next = NULL; he->hash = hash; he->key = key; he->klen = klen; |