diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-04-07 14:08:04 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-04-07 14:08:04 +0000 |
commit | 94e32ce7f885ecc648ae6377276f8813fc1c9347 (patch) | |
tree | 88da0722e206c60326b466b85ab118c00be13f55 /src/core/ngx_hash.c | |
parent | 7469680c6c32901e7b6082a0e564430b587bbcfa (diff) | |
download | nginx-release-0.3.37.tar.gz nginx-release-0.3.37.zip |
nginx-0.3.37-RELEASE importrelease-0.3.37
*) Feature: the "limit_except" directive.
*) Feature: the "if" directive supports the "!~", "!~*", "-f", and
"!-f" operators.
*) Feature: the ngx_http_perl_module supports the $r->request_body
method.
*) Bugfix: in the ngx_http_addition_filter_module.
Diffstat (limited to 'src/core/ngx_hash.c')
-rw-r--r-- | src/core/ngx_hash.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c index 2876318a3..0ee5e77ca 100644 --- a/src/core/ngx_hash.c +++ b/src/core/ngx_hash.c @@ -164,10 +164,14 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts) return NGX_ERROR; } - start = nelts / (ngx_cacheline_size / (2 * sizeof(void *)) - 1); + bucket_size = hinit->bucket_size - sizeof(void *); + + start = nelts / (bucket_size / (2 * sizeof(void *)) - 1); start = start ? start : 1; - bucket_size = hinit->bucket_size - sizeof(void *); + if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) { + start = hinit->max_size - 1000; + } for (size = start; size < hinit->max_size; size++) { |