diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-10-04 14:57:56 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-10-04 14:57:56 +0300 |
commit | ba311997866a4c2ef6ceeaac846832a85bd86f17 (patch) | |
tree | 74c268496a856065eec13b57db2a5158da2b6cd1 /src/nxt_process.c | |
parent | 4ae76249edb97775be8a0c749ad9ee79e3e85393 (diff) | |
download | unit-ba311997866a4c2ef6ceeaac846832a85bd86f17.tar.gz unit-ba311997866a4c2ef6ceeaac846832a85bd86f17.tar.bz2 |
Removing mem_pool from port_hash interface.
Memory pool is not used by port_hash and it was a mistake to pass it into
'add' and 'remove' functions. port_hash enrties are allocated from heap.
Diffstat (limited to 'src/nxt_process.c')
-rw-r--r-- | src/nxt_process.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c index e6653bd7..95e701f8 100644 --- a/src/nxt_process.c +++ b/src/nxt_process.c @@ -619,13 +619,7 @@ nxt_process_connected_port_add(nxt_process_t *process, nxt_port_t *port) { nxt_thread_mutex_lock(&process->cp_mutex); - if (process->cp_mem_pool == NULL) { - process->cp_mem_pool = nxt_mp_create(1024, 128, 256, 32); - } - - nxt_mp_thread_adopt(process->cp_mem_pool); - - nxt_port_hash_add(&process->connected_ports, process->cp_mem_pool, port); + nxt_port_hash_add(&process->connected_ports, port); nxt_thread_mutex_unlock(&process->cp_mutex); } @@ -635,12 +629,7 @@ nxt_process_connected_port_remove(nxt_process_t *process, nxt_port_t *port) { nxt_thread_mutex_lock(&process->cp_mutex); - if (process->cp_mem_pool != NULL) { - nxt_mp_thread_adopt(process->cp_mem_pool); - - nxt_port_hash_remove(&process->connected_ports, process->cp_mem_pool, - port); - } + nxt_port_hash_remove(&process->connected_ports, port); nxt_thread_mutex_unlock(&process->cp_mutex); } |