Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-06-21 01:06:53 +0400
committerIgor Sysoev <igor@sysoev.ru>2008-06-21 01:06:53 +0400
commit11864a706a6b109ec462d3d6be7413713de88846 (patch)
treea63247c70dda94eaa268e2b34557bc8048e8b030 /src
parent5a4c61658bf62c999318b92d2b76f30a2626621a (diff)
fix the previous commit
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_palloc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c
index 8c69db773..971887fd4 100644
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -159,14 +159,19 @@ ngx_palloc_block(ngx_pool_t *pool, size_t size)
psize = (size_t) (pool->d.end - (u_char *) pool);
- new = ngx_alloc(size, pool->log);
- if (new == NULL) {
+ m = ngx_alloc(psize, pool->log);
+ if (m == NULL) {
return NULL;
}
- new->d.end = (u_char *) new + psize;
+ new = (ngx_pool_t *) m;
+
+ new->d.end = m + psize;
new->d.next = NULL;
+ m += sizeof(ngx_pool_data_t);
+ new->d.last = m + size;
+
current = pool->current;
for (p = current; p->d.next; p = p->d.next) {
@@ -179,9 +184,6 @@ ngx_palloc_block(ngx_pool_t *pool, size_t size)
pool->current = current ? current : new;
- m = (u_char *) new + sizeof(ngx_pool_data_t);
- new->d.last = m + size;
-
return m;
}