comparison src/core/ngx_list.c @ 5253:a82f305487c2

Simplified ngx_list_create().
author Ruslan Ermilov <ru@nginx.com>
date Wed, 19 Jun 2013 08:55:08 +0400
parents d620f497c50f
children
comparison
equal deleted inserted replaced
5252:982678c5c270 5253:a82f305487c2
17 list = ngx_palloc(pool, sizeof(ngx_list_t)); 17 list = ngx_palloc(pool, sizeof(ngx_list_t));
18 if (list == NULL) { 18 if (list == NULL) {
19 return NULL; 19 return NULL;
20 } 20 }
21 21
22 list->part.elts = ngx_palloc(pool, n * size); 22 if (ngx_list_init(list, pool, n, size) != NGX_OK) {
23 if (list->part.elts == NULL) {
24 return NULL; 23 return NULL;
25 } 24 }
26
27 list->part.nelts = 0;
28 list->part.next = NULL;
29 list->last = &list->part;
30 list->size = size;
31 list->nalloc = n;
32 list->pool = pool;
33 25
34 return list; 26 return list;
35 } 27 }
36 28
37 29