diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nginx.h | 2 | ||||
-rw-r--r-- | src/core/ngx_hash.c | 8 | ||||
-rw-r--r-- | src/core/ngx_inet.c | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h index 3f910cb26..06e46c0c6 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.3.36" +#define NGINX_VER "nginx/0.3.37" #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" 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++) { diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index ee68fc1c2..a42df699b 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -21,8 +21,8 @@ */ -static -ngx_inline size_t ngx_sprint_uchar(u_char *text, u_char c, size_t len) +static ngx_inline size_t +ngx_sprint_uchar(u_char *text, u_char c, size_t len) { size_t n; ngx_uint_t c1, c2; |