summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_array.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2020-08-13 02:46:54 +0300
committerValentin Bartenev <vbart@nginx.com>2020-08-13 02:46:54 +0300
commit93146616cf56a94fc2979cb978c7b451c5592594 (patch)
treedb840e75ef2c08731e699b4eb44641ad6639c2ca /src/nxt_array.h
parent21ac95f17e70f2f20fe8e2a99bbe9cc7328a6e62 (diff)
downloadunit-93146616cf56a94fc2979cb978c7b451c5592594.tar.gz
unit-93146616cf56a94fc2979cb978c7b451c5592594.tar.bz2
Basic variables support.
Diffstat (limited to '')
-rw-r--r--src/nxt_array.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nxt_array.h b/src/nxt_array.h
index 5762ec27..8318fccd 100644
--- a/src/nxt_array.h
+++ b/src/nxt_array.h
@@ -18,6 +18,14 @@ typedef struct {
} nxt_array_t;
+nxt_inline void
+nxt_array_init(nxt_array_t *array, nxt_mp_t *mp, size_t size)
+{
+ array->elts = nxt_pointer_to(array, sizeof(nxt_array_t));
+ array->size = size;
+ array->mem_pool = mp;
+}
+
NXT_EXPORT nxt_array_t *nxt_array_create(nxt_mp_t *mp, nxt_uint_t n,
size_t size);
NXT_EXPORT void nxt_array_destroy(nxt_array_t *array);