comparison src/core/ngx_palloc.c @ 452:23fb87bddda1 release-0.1.1

nginx-0.1.1-RELEASE import *) Feature: the gzip_types directive. *) Feature: the tcp_nodelay directive. *) Feature: the send_lowat directive is working not only on OSes that support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT. *) Feature: the setproctitle() emulation for Linux and Solaris. *) Bugfix: the "Location" header rewrite bug fixed while the proxying. *) Bugfix: the ngx_http_chunked_module module may get caught in an endless loop. *) Bugfix: the /dev/poll module bugs fixed. *) Bugfix: the responses were corrupted when the temporary files were used while the proxying. *) Bugfix: the unescaped requests were passed to the backend. *) Bugfix: while the build configuration on Linux 2.4 the --with-poll_module parameter was required.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 11 Oct 2004 15:07:03 +0000
parents 42d11f017717
children a88a3e4e158f
comparison
equal deleted inserted replaced
451:f40362e47689 452:23fb87bddda1
75 char *m; 75 char *m;
76 ngx_pool_t *p, *n; 76 ngx_pool_t *p, *n;
77 ngx_pool_large_t *large, *last; 77 ngx_pool_large_t *large, *last;
78 78
79 if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL 79 if (size <= (size_t) NGX_MAX_ALLOC_FROM_POOL
80 && size <= (size_t) (pool->end - (char *) pool) - sizeof(ngx_pool_t)) 80 && size <= (size_t) (pool->end - (char *) pool)
81 - (size_t) ngx_align(sizeof(ngx_pool_t)))
81 { 82 {
82 for (p = pool, n = pool->next; /* void */; p = n, n = n->next) { 83 for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
83 m = ngx_align(p->last); 84 m = ngx_align(p->last);
84 85
85 if ((size_t) (p->end - m) >= size) { 86 if ((size_t) (p->end - m) >= size) {
86 p->last = m + size ; 87 p->last = m + size;
87 88
88 return m; 89 return m;
89 } 90 }
90 91
91 if (n == NULL) { 92 if (n == NULL) {
98 if (!(n = ngx_create_pool((size_t) (p->end - (char *) p), p->log))) { 99 if (!(n = ngx_create_pool((size_t) (p->end - (char *) p), p->log))) {
99 return NULL; 100 return NULL;
100 } 101 }
101 102
102 p->next = n; 103 p->next = n;
103 m = n->last; 104 m = ngx_align(n->last);
104 n->last += size; 105 n->last = m + size;
105 106
106 return m; 107 return m;
107 } 108 }
108 109
109 /* allocate a large block */ 110 /* allocate a large block */