diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-12-28 16:01:06 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-12-28 16:01:06 +0300 |
commit | 497faf1b9abb188cab40c389a9e6221add5dd496 (patch) | |
tree | cb25d7f278a6706cf6f74cd25982764ca1d0c4f6 /src/nxt_port_socket.c | |
parent | b59535b22c73b04ed85c0bc1287203e3449c645b (diff) | |
download | unit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.gz unit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.bz2 |
Changed nxt_mp_retain() and nxt_mp_release() interfaces.
Diffstat (limited to 'src/nxt_port_socket.c')
-rw-r--r-- | src/nxt_port_socket.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c index 34e57a3c..c3485bdb 100644 --- a/src/nxt_port_socket.c +++ b/src/nxt_port_socket.c @@ -159,21 +159,26 @@ nxt_port_release_send_msg(nxt_task_t *task, void *obj, void *data) return; } - nxt_mp_release(engine->mem_pool, obj); + nxt_mp_free(engine->mem_pool, obj); + nxt_mp_release(engine->mem_pool); } static nxt_port_send_msg_t * nxt_port_msg_create(nxt_task_t *task, nxt_port_send_msg_t *m) { + nxt_mp_t *mp; nxt_port_send_msg_t *msg; - msg = nxt_mp_retain(task->thread->engine->mem_pool, - sizeof(nxt_port_send_msg_t)); + mp = task->thread->engine->mem_pool; + + msg = nxt_mp_alloc(mp, sizeof(nxt_port_send_msg_t)); if (nxt_slow_path(msg == NULL)) { return NULL; } + nxt_mp_retain(mp); + msg->link.next = NULL; msg->link.prev = NULL; |