Home
last modified time | relevance | path

Searched refs:mp (Results 1 – 25 of 80) sorted by relevance

1234

/unit/src/
H A Dnxt_mp.c282 return mp; in nxt_mp_create()
289 mp->retain++; in nxt_mp_retain()
291 nxt_thread_log_debug("mp %p retain: %uD", mp, mp->retain); in nxt_mp_retain()
298 mp->retain--; in nxt_mp_release()
300 nxt_thread_log_debug("mp %p release: %uD", mp, mp->retain); in nxt_mp_release()
345 nxt_free(mp); in nxt_mp_destroy()
673 n = mp->cluster_size >> mp->page_size_shift; in nxt_mp_alloc_cluster()
938 n = mp->cluster_size >> mp->page_size_shift; in nxt_mp_chunk_free()
952 n = mp->cluster_size >> mp->page_size_shift; in nxt_mp_chunk_free()
980 p = nxt_mp_get_small(mp, &mp->nget_pages, size); in nxt_mp_nget()
[all …]
H A Dnxt_mp.h42 NXT_EXPORT void nxt_mp_destroy(nxt_mp_t *mp);
47 NXT_EXPORT void nxt_mp_retain(nxt_mp_t *mp);
53 NXT_EXPORT void nxt_mp_release(nxt_mp_t *mp);
60 NXT_EXPORT nxt_bool_t nxt_mp_is_empty(nxt_mp_t *mp);
67 NXT_EXPORT void *nxt_mp_alloc(nxt_mp_t *mp, size_t size)
75 NXT_EXPORT void *nxt_mp_zalloc(nxt_mp_t *mp, size_t size)
87 NXT_EXPORT void nxt_mp_free(nxt_mp_t *mp, void *p);
91 NXT_EXPORT void *nxt_mp_nget(nxt_mp_t *mp, size_t size)
98 NXT_EXPORT void *nxt_mp_get(nxt_mp_t *mp, size_t size)
105 NXT_EXPORT void *nxt_mp_zget(nxt_mp_t *mp, size_t size)
[all …]
H A Dnxt_buf.c42 b->data = mp; in nxt_buf_mem_alloc()
67 nxt_mp_retain(mp); in nxt_buf_mem_ts_alloc()
71 b->data = mp; in nxt_buf_mem_ts_alloc()
107 b->data = mp; in nxt_buf_file_alloc()
130 b->data = mp; in nxt_buf_mmap_alloc()
150 b->data = mp; in nxt_buf_sync_alloc()
200 nxt_mp_t *mp; in nxt_buf_completion() local
212 mp = b->data; in nxt_buf_completion()
214 nxt_mp_free(mp, b); in nxt_buf_completion()
273 nxt_mp_t *mp; in nxt_buf_ts_completion() local
[all …]
H A Dnxt_status.c12 nxt_status_get(nxt_status_report_t *report, nxt_mp_t *mp) in nxt_status_get() argument
32 status = nxt_conf_create_object(mp, 3); in nxt_status_get()
37 obj = nxt_conf_create_object(mp, 4); in nxt_status_get()
51 obj = nxt_conf_create_object(mp, 1); in nxt_status_get()
60 apps = nxt_conf_create_object(mp, report->apps_count); in nxt_status_get()
70 app_obj = nxt_conf_create_object(mp, 2); in nxt_status_get()
78 ret = nxt_conf_set_member_dup(apps, mp, &name, app_obj, i); in nxt_status_get()
83 obj = nxt_conf_create_object(mp, 3); in nxt_status_get()
94 obj = nxt_conf_create_object(mp, 1); in nxt_status_get()
H A Dnxt_conf.h94 NXT_EXPORT nxt_int_t nxt_conf_map_object(nxt_mp_t *mp, nxt_conf_value_t *value,
97 nxt_conf_op_ret_t nxt_conf_op_compile(nxt_mp_t *mp, nxt_conf_op_t **ops,
100 nxt_conf_value_t *nxt_conf_clone(nxt_mp_t *mp, nxt_conf_op_t *op,
103 nxt_conf_value_t *nxt_conf_json_parse(nxt_mp_t *mp, u_char *start, u_char *end,
106 #define nxt_conf_json_parse_str(mp, str) \ argument
107 nxt_conf_json_parse(mp, (str)->start, (str)->start + (str)->length, NULL)
121 nxt_mp_t *mp, const nxt_str_t *str);
127 nxt_conf_value_t *nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count);
130 nxt_int_t nxt_conf_set_member_dup(nxt_conf_value_t *object, nxt_mp_t *mp,
134 nxt_int_t nxt_conf_set_member_string_dup(nxt_conf_value_t *object, nxt_mp_t *mp,
[all …]
H A Dnxt_pcre2.c24 nxt_regex_compile(nxt_mp_t *mp, nxt_str_t *source, nxt_regex_err_t *err) in nxt_regex_compile() argument
36 nxt_pcre2_free, mp); in nxt_regex_compile()
46 re = nxt_mp_get(mp, sizeof(nxt_regex_t)); in nxt_regex_compile()
51 if (nxt_slow_path(nxt_str_dup(mp, &re->pattern, source) == NULL)) { in nxt_regex_compile()
98 nxt_pcre2_malloc(PCRE2_SIZE size, void *mp) in nxt_pcre2_malloc() argument
100 return nxt_mp_get(mp, size); in nxt_pcre2_malloc()
105 nxt_pcre2_free(void *p, void *mp) in nxt_pcre2_free() argument
111 nxt_regex_match_create(nxt_mp_t *mp, size_t size) in nxt_regex_match_create() argument
116 ctx = pcre2_general_context_create(nxt_pcre2_malloc, nxt_pcre2_free, mp); in nxt_regex_match_create()
H A Dnxt_job.c16 nxt_job_create(nxt_mp_t *mp, size_t size) in nxt_job_create() argument
21 if (mp == NULL) { in nxt_job_create()
22 mp = nxt_mp_create(1024, 128, 256, 32); in nxt_job_create()
23 if (nxt_slow_path(mp == NULL)) { in nxt_job_create()
27 job = nxt_mp_zget(mp, size); in nxt_job_create()
31 job = nxt_mp_zalloc(mp, size); in nxt_job_create()
37 job->mem_pool = mp; in nxt_job_create()
83 nxt_job_cleanup_add(nxt_mp_t *mp, nxt_job_t *job)
87 mpcl = nxt_mem_pool_cleanup(mp, 0);
H A Dnxt_buf.h215 NXT_EXPORT nxt_buf_t *nxt_buf_mem_alloc(nxt_mp_t *mp, size_t size,
217 NXT_EXPORT nxt_buf_t *nxt_buf_mem_ts_alloc(nxt_task_t *task, nxt_mp_t *mp,
219 NXT_EXPORT nxt_buf_t *nxt_buf_file_alloc(nxt_mp_t *mp, size_t size,
221 NXT_EXPORT nxt_buf_t *nxt_buf_mmap_alloc(nxt_mp_t *mp, size_t size);
222 NXT_EXPORT nxt_buf_t *nxt_buf_sync_alloc(nxt_mp_t *mp, nxt_uint_t flags);
227 NXT_EXPORT nxt_buf_t *nxt_buf_make_plain(nxt_mp_t *mp, nxt_buf_t *src,
231 nxt_buf_chk_make_plain(nxt_mp_t *mp, nxt_buf_t *src, size_t size) in nxt_buf_chk_make_plain() argument
234 return nxt_buf_make_plain(mp, src, size); in nxt_buf_chk_make_plain()
240 #define nxt_buf_free(mp, b) \ argument
241 nxt_mp_free((mp), (b))
H A Dnxt_cert.c32 nxt_mp_t *mp; member
368 nxt_mp_t *mp; in nxt_cert_info_save() local
394 info->mp = mp; in nxt_cert_info_save()
410 nxt_mp_destroy(info->mp); in nxt_cert_info_save()
417 nxt_mp_destroy(mp); in nxt_cert_info_save()
805 nxt_mp_destroy(info->mp); in nxt_cert_info_delete()
1076 nxt_mp_retain(mp); in nxt_cert_store_get()
1111 nxt_mp_t *mp; in nxt_cert_buf_completion() local
1115 mp = b->data; in nxt_cert_buf_completion()
1118 nxt_mp_free(mp, b); in nxt_cert_buf_completion()
[all …]
H A Dnxt_sockaddr.h65 NXT_EXPORT nxt_sockaddr_t *nxt_sockaddr_alloc(nxt_mp_t *mp, socklen_t socklen,
68 NXT_EXPORT nxt_sockaddr_t *nxt_sockaddr_create(nxt_mp_t *mp,
71 NXT_EXPORT nxt_sockaddr_t *nxt_sockaddr_copy(nxt_mp_t *mp, nxt_sockaddr_t *src)
73 NXT_EXPORT nxt_sockaddr_t *nxt_getsockname(nxt_task_t *task, nxt_mp_t *mp,
82 NXT_EXPORT nxt_sockaddr_t *nxt_sockaddr_parse(nxt_mp_t *mp, nxt_str_t *addr);
83 NXT_EXPORT nxt_sockaddr_t *nxt_sockaddr_parse_optport(nxt_mp_t *mp,
H A Dnxt_array.h22 nxt_array_init(nxt_array_t *array, nxt_mp_t *mp, size_t size) in nxt_array_init() argument
26 array->mem_pool = mp; in nxt_array_init()
29 NXT_EXPORT nxt_array_t *nxt_array_create(nxt_mp_t *mp, nxt_uint_t n,
35 NXT_EXPORT nxt_array_t *nxt_array_copy(nxt_mp_t *mp, nxt_array_t *dst,
H A Dnxt_conf.c203 ptr = nxt_str_dup(mp, &tmp, str); in nxt_conf_set_string_dup()
253 value = nxt_mp_get(mp, size); in nxt_conf_create_object()
368 value = nxt_mp_get(mp, size); in nxt_conf_create_array()
958 rc = nxt_conf_copy_value(mp, op, copy, value); in nxt_conf_clone()
1034 dst->u.array = nxt_mp_get(mp, size); in nxt_conf_copy_array()
1136 dst->u.object = nxt_mp_get(mp, size); in nxt_conf_copy_object()
1160 rc = nxt_conf_copy_value(mp, NULL, in nxt_conf_copy_object()
1168 rc = nxt_conf_copy_value(mp, pass_op, in nxt_conf_copy_object()
1195 rc = nxt_conf_copy_value(mp, NULL, in nxt_conf_copy_object()
1209 rc = nxt_conf_copy_value(mp, NULL, in nxt_conf_copy_object()
[all …]
H A Dnxt_credential.c9 static nxt_int_t nxt_credential_groups_get(nxt_task_t *task, nxt_mp_t *mp,
14 nxt_credential_get(nxt_task_t *task, nxt_mp_t *mp, nxt_credential_t *uc, in nxt_credential_get() argument
63 if (nxt_credential_groups_get(task, mp, uc) != NXT_OK) { in nxt_credential_get()
95 nxt_credential_groups_get(nxt_task_t *task, nxt_mp_t *mp, in nxt_credential_groups_get() argument
119 uc->gids = nxt_mp_alloc(mp, ngroups * sizeof(gid_t)); in nxt_credential_groups_get()
138 uc->gids = nxt_mp_alloc(mp, ngroups * sizeof(gid_t)); in nxt_credential_groups_get()
180 nxt_credential_groups_get(nxt_task_t *task, nxt_mp_t *mp, nxt_credential_t *uc) in nxt_credential_groups_get() argument
204 saved = nxt_mp_alloc(mp, nsaved * sizeof(nxt_gid_t)); in nxt_credential_groups_get()
247 uc->gids = nxt_mp_alloc(mp, ngroups * sizeof(nxt_gid_t)); in nxt_credential_groups_get()
273 nxt_mp_free(mp, saved); in nxt_credential_groups_get()
H A Dnxt_sockaddr.c79 sa = nxt_mp_zalloc(mp, size); in nxt_sockaddr_alloc()
147 sa = nxt_sockaddr_alloc(mp, size, address_length); in nxt_sockaddr_create()
166 nxt_sockaddr_copy(nxt_mp_t *mp, nxt_sockaddr_t *src) in nxt_sockaddr_copy() argument
173 dst = nxt_mp_alloc(mp, length); in nxt_sockaddr_copy()
524 nxt_sockaddr_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_parse() argument
528 sa = nxt_sockaddr_parse_optport(mp, addr); in nxt_sockaddr_parse()
554 sa = nxt_sockaddr_unix_parse(mp, addr); in nxt_sockaddr_parse_optport()
557 sa = nxt_sockaddr_inet6_parse(mp, addr); in nxt_sockaddr_parse_optport()
560 sa = nxt_sockaddr_inet_parse(mp, addr); in nxt_sockaddr_parse_optport()
572 nxt_sockaddr_unix_parse(nxt_mp_t *mp, nxt_str_t *addr) in nxt_sockaddr_unix_parse() argument
[all …]
H A Dnxt_upstream_round_robin.c49 nxt_mp_t *mp; in nxt_upstream_round_robin_create() local
58 mp = tmcf->router_conf->mem_pool; in nxt_upstream_round_robin_create()
86 urr = nxt_mp_zalloc(mp, size); in nxt_upstream_round_robin_create()
97 sa = nxt_sockaddr_parse(mp, &name); in nxt_upstream_round_robin_create()
128 nxt_mp_t *mp; in nxt_upstream_round_robin_joint_create() local
132 mp = tmcf->router_conf->mem_pool; in nxt_upstream_round_robin_joint_create()
134 u = nxt_mp_alloc(mp, sizeof(nxt_upstream_t)); in nxt_upstream_round_robin_joint_create()
146 urr = nxt_mp_alloc(mp, size); in nxt_upstream_round_robin_joint_create()
H A Dnxt_http_return.c25 static nxt_int_t nxt_http_return_encode(nxt_mp_t *mp, nxt_str_t *encoded,
38 nxt_mp_t *mp; in nxt_http_return_init() local
42 mp = rtcf->mem_pool; in nxt_http_return_init()
44 conf = nxt_mp_zget(mp, sizeof(nxt_http_return_conf_t)); in nxt_http_return_init()
60 conf->location = nxt_var_compile(&str, mp, rtcf->var_fields, 0); in nxt_http_return_init()
67 return nxt_http_return_encode(mp, &conf->encoded, &str); in nxt_http_return_init()
147 nxt_http_return_encode(nxt_mp_t *mp, nxt_str_t *encoded, in nxt_http_return_encode() argument
161 encoded->start = nxt_mp_nget(mp, encoded->length); in nxt_http_return_encode()
H A Dnxt_pcre.c30 nxt_regex_compile(nxt_mp_t *mp, nxt_str_t *source, nxt_regex_err_t *err) in nxt_regex_compile() argument
39 re = nxt_mp_get(mp, sizeof(nxt_regex_t) + source->length + 1); in nxt_regex_compile()
58 nxt_pcre_mp = mp; in nxt_regex_compile()
105 nxt_regex_match_create(nxt_mp_t *mp, size_t size) in nxt_regex_match_create() argument
109 match = nxt_mp_get(mp, sizeof(nxt_regex_match_t) + sizeof(int) * size); in nxt_regex_match_create()
H A Dnxt_cert.h19 nxt_conf_value_t *nxt_cert_info_get_all(nxt_mp_t *mp);
25 void nxt_cert_store_get(nxt_task_t *task, nxt_str_t *name, nxt_mp_t *mp,
27 void nxt_cert_store_delete(nxt_task_t *task, nxt_str_t *name, nxt_mp_t *mp);
H A Dnxt_http_route.c239 nxt_mp_t *mp; in nxt_http_routes_create() local
250 mp = tmcf->router_conf->mem_pool; in nxt_http_routes_create()
252 routes = nxt_mp_alloc(mp, size); in nxt_http_routes_create()
398 nxt_mp_t *mp; in nxt_http_route_match_create() local
418 match = nxt_mp_alloc(mp, size); in nxt_http_route_match_create()
643 nxt_mp_t *mp; in nxt_http_action_init() local
660 mp = rtcf->mem_pool; in nxt_http_action_init()
700 table = nxt_mp_alloc(mp, size); in nxt_http_route_table_create()
816 rule = nxt_mp_alloc(mp, size); in nxt_http_route_rule_create()
1487 nxt_mp_t *mp; in nxt_http_action_create() local
[all …]
H A Dnxt_job_cache_file.c12 nxt_job_cache_file_create(nxt_mp_t *mp) in nxt_job_cache_file_create() argument
16 jbc = nxt_job_create(mp, sizeof(nxt_job_cache_file_t)); in nxt_job_cache_file_create()
H A Dnxt_array.c11 nxt_array_create(nxt_mp_t *mp, nxt_uint_t n, size_t size) in nxt_array_create() argument
15 array = nxt_mp_alloc(mp, sizeof(nxt_array_t) + n * size); in nxt_array_create()
25 array->mem_pool = mp; in nxt_array_create()
115 nxt_array_copy(nxt_mp_t *mp, nxt_array_t *dst, nxt_array_t *src) in nxt_array_copy() argument
123 dst = nxt_array_create(mp, src->nelts, size); in nxt_array_copy()
H A Dnxt_conn.c43 nxt_conn_create(nxt_mp_t *mp, nxt_task_t *task) in nxt_conn_create() argument
48 c = nxt_mp_zget(mp, sizeof(nxt_conn_t)); in nxt_conn_create()
53 c->mem_pool = mp; in nxt_conn_create()
95 nxt_mp_t *mp; in nxt_conn_free() local
99 mp = c->mem_pool; in nxt_conn_free()
100 nxt_mp_release(mp); in nxt_conn_free()
H A Dnxt_router_access_log.c328 nxt_mp_t *mp; in nxt_router_access_log_reopen_handler() local
343 mp = nxt_mp_create(1024, 128, 256, 32); in nxt_router_access_log_reopen_handler()
344 if (nxt_slow_path(mp == NULL)) { in nxt_router_access_log_reopen_handler()
348 reopen = nxt_mp_get(mp, sizeof(nxt_router_access_log_reopen_t)); in nxt_router_access_log_reopen_handler()
353 reopen->mem_pool = mp; in nxt_router_access_log_reopen_handler()
356 b = nxt_buf_mem_alloc(mp, access_log->path.length + 1, 0); in nxt_router_access_log_reopen_handler()
386 nxt_mp_retain(mp); in nxt_router_access_log_reopen_handler()
392 nxt_mp_destroy(mp); in nxt_router_access_log_reopen_handler()
399 nxt_mp_t *mp; in nxt_router_access_log_reopen_completion() local
403 mp = b->data; in nxt_router_access_log_reopen_completion()
[all …]
/unit/src/test/
H A Dnxt_mp_test.c18 nxt_mp_t *mp; in nxt_mp_test() local
42 mp = nxt_mp_create(cluster_size, page_alignment, page_size, min_chunk_size); in nxt_mp_test()
43 if (mp == NULL) { in nxt_mp_test()
63 blocks[n] = nxt_mp_alloc(mp, size); in nxt_mp_test()
73 nxt_mp_free(mp, blocks[n]); in nxt_mp_test()
77 if (!nxt_mp_is_empty(mp)) { in nxt_mp_test()
82 nxt_mp_destroy(mp); in nxt_mp_test()
H A Dnxt_lvlhsh_test.c121 nxt_mp_t *mp; in nxt_lvlhsh_test() local
137 mp = nxt_mp_create(cluster_size, page_alignment, page_size, in nxt_lvlhsh_test()
139 if (mp == NULL) { in nxt_lvlhsh_test()
151 mp = NULL; in nxt_lvlhsh_test()
160 if (nxt_lvlhsh_test_add(&lh, proto, mp, key) != NXT_OK) { in nxt_lvlhsh_test()
199 if (nxt_lvlhsh_test_delete(&lh, proto, mp, key) != NXT_OK) { in nxt_lvlhsh_test()
220 if (nxt_lvlhsh_test_add(&lh, proto, mp, key) != NXT_OK) { in nxt_lvlhsh_test()
228 value = nxt_lvlhsh_retrieve(&lh, proto, mp); in nxt_lvlhsh_test()
247 if (mp != NULL) { in nxt_lvlhsh_test()
248 if (!nxt_mp_is_empty(mp)) { in nxt_lvlhsh_test()
[all …]

1234