Klaus Demo nginx / 7f9305c
do not test a pool block space if we can not allocated from the block 4 times Igor Sysoev 13 years ago
2 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2424 p->d.last = (u_char *) p + sizeof(ngx_pool_t);
2525 p->d.end = (u_char *) p + size;
2626 p->d.next = NULL;
27 p->d.failed = 0;
2728
2829 size = size - sizeof(ngx_pool_t);
2930 p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
188189
189190 new->d.end = m + psize;
190191 new->d.next = NULL;
192 new->d.failed = 0;
191193
192194 m += sizeof(ngx_pool_data_t);
193195 m = ngx_align_ptr(m, NGX_ALIGNMENT);
196198 current = pool->current;
197199
198200 for (p = current; p->d.next; p = p->d.next) {
199 if ((size_t) (p->d.end - p->d.last) < NGX_ALIGNMENT) {
201 if (p->d.failed++ > 4) {
200202 current = p->d.next;
201203 }
202204 }
4545 u_char *last;
4646 u_char *end;
4747 ngx_pool_t *next;
48 ngx_uint_t failed;
4849 } ngx_pool_data_t;
4950
5051