Event engine memory cache for nxt_sockaddr_t.

Introducing event engine memory cache and using the cache for
nxt_sockaddr_t structures.
This commit is contained in:
Igor Sysoev
2017-09-27 19:22:59 +03:00
parent 752038eea8
commit bfa808d689
8 changed files with 185 additions and 20 deletions

View File

@@ -118,10 +118,18 @@ nxt_controller_start(nxt_task_t *task, void *data)
nxt_str_t *json;
nxt_runtime_t *rt;
nxt_conf_value_t *conf;
nxt_event_engine_t *engine;
nxt_http_fields_hash_t *hash;
rt = task->thread->runtime;
engine = task->thread->engine;
engine->mem_pool = nxt_mp_create(4096, 128, 1024, 64);
if (nxt_slow_path(engine->mem_pool == NULL)) {
return NXT_ERROR;
}
hash = nxt_http_fields_hash_create(nxt_controller_request_fields,
rt->mem_pool);
if (nxt_slow_path(hash == NULL)) {
@@ -686,6 +694,8 @@ nxt_controller_conn_free(nxt_task_t *task, void *obj, void *data)
nxt_debug(task, "controller conn free");
nxt_sockaddr_cache_free(task->thread->engine, c);
nxt_mp_destroy(c->mem_pool);
//nxt_free(c);