comparison src/core/ngx_hash.c @ 180:4cd3e70c4d60 NGINX_0_3_37

nginx 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.
author Igor Sysoev <http://sysoev.ru>
date Fri, 07 Apr 2006 00:00:00 +0400
parents 3314be145cb9
children e6da4931e0e0
comparison
equal deleted inserted replaced
179:654cbdc0401d 180:4cd3e70c4d60
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