Mercurial > hg > nginx-ranges
diff src/core/ngx_palloc.c @ 507:207ae3ff0444 NGINX_0_8_1
nginx 0.8.1
*) Feature: the "updating" parameter in "proxy_cache_use_stale" and
"fastcgi_cache_use_stale" directives.
*) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
header lines were passed to backend while caching if no
"proxy_set_header" directive was used with any parameters.
*) Bugfix: the "Set-Cookie" and "P3P" response header lines were not
hidden while caching if no "proxy_hide_header/fastcgi_hide_header"
directives were used with any parameters.
*) Bugfix: the ngx_http_image_filter_module did not support GIF87a
format.
Thanks to Denis Ilyinyh.
*) Bugfix: nginx could not be built modules on Solaris 10 and early;
the bug had appeared in 0.7.56.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 08 Jun 2009 00:00:00 +0400 |
parents | c8cfb6c462ef |
children | f7ec98e3caeb |
line wrap: on
line diff
--- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -25,6 +25,7 @@ ngx_create_pool(size_t size, ngx_log_t * p->d.last = (u_char *) p + sizeof(ngx_pool_t); p->d.end = (u_char *) p + size; p->d.next = NULL; + p->d.failed = 0; size = size - sizeof(ngx_pool_t); p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL; @@ -189,6 +190,7 @@ ngx_palloc_block(ngx_pool_t *pool, size_ new->d.end = m + psize; new->d.next = NULL; + new->d.failed = 0; m += sizeof(ngx_pool_data_t); m = ngx_align_ptr(m, NGX_ALIGNMENT); @@ -197,7 +199,7 @@ ngx_palloc_block(ngx_pool_t *pool, size_ current = pool->current; for (p = current; p->d.next; p = p->d.next) { - if ((size_t) (p->d.end - p->d.last) < NGX_ALIGNMENT) { + if (p->d.failed++ > 4) { current = p->d.next; } } @@ -214,6 +216,7 @@ static void * ngx_palloc_large(ngx_pool_t *pool, size_t size) { void *p; + ngx_uint_t n; ngx_pool_large_t *large; p = ngx_alloc(size, pool->log); @@ -221,6 +224,19 @@ ngx_palloc_large(ngx_pool_t *pool, size_ return NULL; } + n = 0; + + for (large = pool->large; large; large = large->next) { + if (large->alloc == NULL) { + large->alloc = p; + return p; + } + + if (n++ > 3) { + break; + } + } + large = ngx_palloc(pool, sizeof(ngx_pool_large_t)); if (large == NULL) { ngx_free(p);