diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-06-12 05:54:39 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-06-12 05:54:39 +0000 |
commit | 0915977df53c486abbc6081e1c83f9f8e7a8f111 (patch) | |
tree | 778b5191eed39b3043798423ccc23708e65f116f /src/core/ngx_alloc.c | |
parent | 239baac646073cab7bbaf537ba2d6ca844f2c992 (diff) | |
download | nginx-0915977df53c486abbc6081e1c83f9f8e7a8f111.tar.gz nginx-0915977df53c486abbc6081e1c83f9f8e7a8f111.zip |
nginx-0.0.1-2003-06-12-09:54:39 import
Diffstat (limited to 'src/core/ngx_alloc.c')
-rw-r--r-- | src/core/ngx_alloc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c index af59a223c..050fcbfa8 100644 --- a/src/core/ngx_alloc.c +++ b/src/core/ngx_alloc.c @@ -74,17 +74,17 @@ void ngx_destroy_pool(ngx_pool_t *pool) void *ngx_palloc(ngx_pool_t *pool, size_t size) { - void *m; + char *m; ngx_pool_t *p, *n; ngx_pool_large_t *large, *last; if (size <= NGX_MAX_ALLOC_FROM_POOL) { for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { - if ((size_t) (p->end - ngx_align(p->last)) >= size) { - m = ngx_align(p->last); - p->last = ngx_align(p->last); - p->last += size ; + m = ngx_align(p->last); + + if ((size_t) (p->end - m) >= size) { + p->last = m + size ; return m; } |