Mercurial > hg > nginx-vendor-current
comparison src/core/ngx_array.c @ 382:984bb0b1399b NGINX_0_7_3
nginx 0.7.3
*) Change: the "rss" extension MIME type has been changed to
"application/rss+xml".
*) Change: now the "gzip_vary" directive turned on issues a
"Vary: Accept-Encoding" header line for uncompressed responses too.
*) Feature: now the "rewrite" directive does a redirect automatically
if the "https://" protocol is used.
*) Bugfix: the "proxy_pass" directive did not work with the HTTPS
protocol; the bug had appeared in 0.6.9.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 23 Jun 2008 00:00:00 +0400 |
parents | bb61aa162c6b |
children | d0f7a625f27c |
comparison
equal
deleted
inserted
replaced
381:23d1555141d9 | 382:984bb0b1399b |
---|---|
37 { | 37 { |
38 ngx_pool_t *p; | 38 ngx_pool_t *p; |
39 | 39 |
40 p = a->pool; | 40 p = a->pool; |
41 | 41 |
42 if ((u_char *) a->elts + a->size * a->nalloc == p->last) { | 42 if ((u_char *) a->elts + a->size * a->nalloc == p->d.last) { |
43 p->last -= a->size * a->nalloc; | 43 p->d.last -= a->size * a->nalloc; |
44 } | 44 } |
45 | 45 |
46 if ((u_char *) a + sizeof(ngx_array_t) == p->last) { | 46 if ((u_char *) a + sizeof(ngx_array_t) == p->d.last) { |
47 p->last = (u_char *) a; | 47 p->d.last = (u_char *) a; |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 | 51 |
52 void * | 52 void * |
62 | 62 |
63 size = a->size * a->nalloc; | 63 size = a->size * a->nalloc; |
64 | 64 |
65 p = a->pool; | 65 p = a->pool; |
66 | 66 |
67 if ((u_char *) a->elts + size == p->last && p->last + a->size <= p->end) | 67 if ((u_char *) a->elts + size == p->d.last |
68 && p->d.last + a->size <= p->d.end) | |
68 { | 69 { |
69 /* | 70 /* |
70 * the array allocation is the last in the pool | 71 * the array allocation is the last in the pool |
71 * and there is space for new allocation | 72 * and there is space for new allocation |
72 */ | 73 */ |
73 | 74 |
74 p->last += a->size; | 75 p->d.last += a->size; |
75 a->nalloc++; | 76 a->nalloc++; |
76 | 77 |
77 } else { | 78 } else { |
78 /* allocate a new array */ | 79 /* allocate a new array */ |
79 | 80 |
109 | 110 |
110 /* the array is full */ | 111 /* the array is full */ |
111 | 112 |
112 p = a->pool; | 113 p = a->pool; |
113 | 114 |
114 if ((u_char *) a->elts + a->size * a->nalloc == p->last | 115 if ((u_char *) a->elts + a->size * a->nalloc == p->d.last |
115 && p->last + size <= p->end) | 116 && p->d.last + size <= p->d.end) |
116 { | 117 { |
117 /* | 118 /* |
118 * the array allocation is the last in the pool | 119 * the array allocation is the last in the pool |
119 * and there is space for new allocation | 120 * and there is space for new allocation |
120 */ | 121 */ |
121 | 122 |
122 p->last += size; | 123 p->d.last += size; |
123 a->nalloc += n; | 124 a->nalloc += n; |
124 | 125 |
125 } else { | 126 } else { |
126 /* allocate a new array */ | 127 /* allocate a new array */ |
127 | 128 |