diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-12-16 15:07:08 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-12-16 15:07:08 +0000 |
commit | 2402502c2f35b831ee89369a532b1ff4e4e19947 (patch) | |
tree | 37fb834956f497f8b2d2862c6c3514e1a25bfb37 /src/core/ngx_palloc.c | |
parent | 74297c285ef173784cac505fd406267ac7c8d3c7 (diff) | |
download | nginx-2402502c2f35b831ee89369a532b1ff4e4e19947.tar.gz nginx-2402502c2f35b831ee89369a532b1ff4e4e19947.zip |
nginx-0.3.16-RELEASE importrelease-0.3.16
*) Feature: the ngx_http_map_module.
*) Feature: the "types_hash_max_size" and "types_hash_bucket_size"
directives.
*) Feature: the "ssi_value_length" directive.
*) Feature: the "worker_rlimit_core" directive.
*) Workaround: the connection number in logs was always 1 if nginx was
built by the icc 8.1 or 9.0 compilers with optimization for
Pentium 4.
*) Bugfix: the "config timefmt" SSI command set incorrect time format.
*) Bugfix: nginx did not close connection to IMAP/POP3 backend for the
SSL connections; the bug had appeared in 0.3.13.
Thanks to Rob Mueller.
*) Bugfix: segmentation fault may occurred in at SSL shutdown; the bug
had appeared in 0.3.13.
Diffstat (limited to 'src/core/ngx_palloc.c')
-rw-r--r-- | src/core/ngx_palloc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c index 3bb0b3598..a0229b2ea 100644 --- a/src/core/ngx_palloc.c +++ b/src/core/ngx_palloc.c @@ -90,10 +90,16 @@ ngx_palloc(ngx_pool_t *pool, size_t size) if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL && size <= (size_t) (pool->end - (u_char *) pool) - - (size_t) ngx_align(sizeof(ngx_pool_t))) + - (size_t) ngx_align_ptr(sizeof(ngx_pool_t), NGX_ALIGNMENT)) { for (p = pool->current; /* void */ ; p = p->next) { - m = ngx_align(p->last); + + if (size < sizeof(int) || (size & 1)) { + m = p->last; + + } else { + m = ngx_align_ptr(p->last, NGX_ALIGNMENT); + } if ((size_t) (p->end - m) >= size) { p->last = m + size; @@ -122,7 +128,7 @@ ngx_palloc(ngx_pool_t *pool, size_t size) } p->next = n; - m = ngx_align(n->last); + m = ngx_align_ptr(n->last, NGX_ALIGNMENT); n->last = m + size; return m; |