| * Copyright (C) Igor Sysoev |
| * Copyright (C) Nginx, Inc. |
| ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size) |
| list = ngx_palloc(pool, sizeof(ngx_list_t)); |
| if (ngx_list_init(list, pool, n, size) != NGX_OK) { |
| ngx_list_push(ngx_list_t *l) |
| if (last->nelts == l->nalloc) { |
| /* the last part is full, allocate a new list part */ |
| last = ngx_palloc(l->pool, sizeof(ngx_list_part_t)); |
| last->elts = ngx_palloc(l->pool, l->nalloc * l->size); |
| if (last->elts == NULL) { |
| elt = (char *) last->elts + l->size * last->nelts; |