aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_array.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_array.h')
-rw-r--r--src/core/ngx_array.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/ngx_array.h b/src/core/ngx_array.h
index f54517fd5..79a86e643 100644
--- a/src/core/ngx_array.h
+++ b/src/core/ngx_array.h
@@ -20,6 +20,23 @@ void ngx_destroy_array(ngx_array_t *a);
void *ngx_push_array(ngx_array_t *a);
+ngx_inline static ngx_int_t ngx_init_array0(ngx_array_t *array, ngx_pool_t *pool,
+ ngx_uint_t n, size_t size)
+{
+ if (!(array->elts = ngx_palloc(pool, n * size))) {
+ return NGX_ERROR;
+ }
+
+ array->nelts = 0;
+ array->size = size;
+ array->nalloc = n;
+ array->pool = pool;
+
+ return NGX_OK;
+}
+
+
+
#define ngx_init_array(a, p, n, s, rc) \
ngx_test_null(a.elts, ngx_palloc(p, n * s), rc); \
a.nelts = 0; a.size = s; a.nalloc = n; a.pool = p;