comparison src/core/ngx_array.c @ 154:bb61aa162c6b NGINX_0_3_24

nginx 0.3.24 *) Workaround: for bug in FreeBSD kqueue. *) Bugfix: now a response generated by the "post_action" directive is not transferred to a client. *) Bugfix: the memory leaks were occurring if many log files were used. *) Bugfix: the first "proxy_redirect" directive was working inside one location. *) Bugfix: on 64-bit platforms segmentation fault may occurred on start if the many names were used in the "server_name" directives; bug appeared in 0.3.18.
author Igor Sysoev <http://sysoev.ru>
date Wed, 01 Feb 2006 00:00:00 +0300
parents 72eb30262aac
children 984bb0b1399b
comparison
equal deleted inserted replaced
153:c73ae658b822 154:bb61aa162c6b
6 6
7 #include <ngx_config.h> 7 #include <ngx_config.h>
8 #include <ngx_core.h> 8 #include <ngx_core.h>
9 9
10 10
11 ngx_array_t *ngx_array_create(ngx_pool_t *p, ngx_uint_t n, size_t size) 11 ngx_array_t *
12 ngx_array_create(ngx_pool_t *p, ngx_uint_t n, size_t size)
12 { 13 {
13 ngx_array_t *a; 14 ngx_array_t *a;
14 15
15 a = ngx_palloc(p, sizeof(ngx_array_t)); 16 a = ngx_palloc(p, sizeof(ngx_array_t));
16 if (a == NULL) { 17 if (a == NULL) {
29 30
30 return a; 31 return a;
31 } 32 }
32 33
33 34
34 void ngx_array_destroy(ngx_array_t *a) 35 void
36 ngx_array_destroy(ngx_array_t *a)
35 { 37 {
36 ngx_pool_t *p; 38 ngx_pool_t *p;
37 39
38 p = a->pool; 40 p = a->pool;
39 41
45 p->last = (u_char *) a; 47 p->last = (u_char *) a;
46 } 48 }
47 } 49 }
48 50
49 51
50 void *ngx_array_push(ngx_array_t *a) 52 void *
53 ngx_array_push(ngx_array_t *a)
51 { 54 {
52 void *elt, *new; 55 void *elt, *new;
53 size_t size; 56 size_t size;
54 ngx_pool_t *p; 57 ngx_pool_t *p;
55 58
90 93
91 return elt; 94 return elt;
92 } 95 }
93 96
94 97
95 void *ngx_array_push_n(ngx_array_t *a, ngx_uint_t n) 98 void *
99 ngx_array_push_n(ngx_array_t *a, ngx_uint_t n)
96 { 100 {
97 void *elt, *new; 101 void *elt, *new;
98 size_t size; 102 size_t size;
99 ngx_uint_t nalloc; 103 ngx_uint_t nalloc;
100 ngx_pool_t *p; 104 ngx_pool_t *p;