comparison src/core/ngx_hash.c @ 631:5d2b8078c1c2 release-0.3.37

nginx-0.3.37-RELEASE import *) 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.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 07 Apr 2006 14:08:04 +0000
parents 7a16e281c01f
children 1e720b0be7ec
comparison
equal deleted inserted replaced
630:375dab4fd227 631:5d2b8078c1c2
162 test = ngx_alloc(hinit->max_size * sizeof(u_short), hinit->pool->log); 162 test = ngx_alloc(hinit->max_size * sizeof(u_short), hinit->pool->log);
163 if (test == NULL) { 163 if (test == NULL) {
164 return NGX_ERROR; 164 return NGX_ERROR;
165 } 165 }
166 166
167 start = nelts / (ngx_cacheline_size / (2 * sizeof(void *)) - 1); 167 bucket_size = hinit->bucket_size - sizeof(void *);
168
169 start = nelts / (bucket_size / (2 * sizeof(void *)) - 1);
168 start = start ? start : 1; 170 start = start ? start : 1;
169 171
170 bucket_size = hinit->bucket_size - sizeof(void *); 172 if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) {
173 start = hinit->max_size - 1000;
174 }
171 175
172 for (size = start; size < hinit->max_size; size++) { 176 for (size = start; size < hinit->max_size; size++) {
173 177
174 ngx_memzero(test, size * sizeof(u_short)); 178 ngx_memzero(test, size * sizeof(u_short));
175 179