summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_memory.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-12-28 16:01:06 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-12-28 16:01:06 +0300
commit497faf1b9abb188cab40c389a9e6221add5dd496 (patch)
treecb25d7f278a6706cf6f74cd25982764ca1d0c4f6 /src/nxt_port_memory.c
parentb59535b22c73b04ed85c0bc1287203e3449c645b (diff)
downloadunit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.gz
unit-497faf1b9abb188cab40c389a9e6221add5dd496.tar.bz2
Changed nxt_mp_retain() and nxt_mp_release() interfaces.
Diffstat (limited to 'src/nxt_port_memory.c')
-rw-r--r--src/nxt_port_memory.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c
index 3a1ec198..7be4347a 100644
--- a/src/nxt_port_memory.c
+++ b/src/nxt_port_memory.c
@@ -173,7 +173,8 @@ release_buf:
nxt_port_mmap_handler_use(mmap_handler, -1);
- nxt_mp_release(mp, b);
+ nxt_mp_free(mp, b);
+ nxt_mp_release(mp);
}
@@ -588,6 +589,7 @@ nxt_buf_t *
nxt_port_mmap_get_buf(nxt_task_t *task, nxt_port_t *port, size_t size)
{
size_t nchunks;
+ nxt_mp_t *mp;
nxt_buf_t *b;
nxt_chunk_id_t c;
nxt_port_mmap_header_t *hdr;
@@ -605,7 +607,9 @@ nxt_port_mmap_get_buf(nxt_task_t *task, nxt_port_t *port, size_t size)
mmap_handler = nxt_port_mmap_get(task, port, &c, 0);
if (nxt_slow_path(mmap_handler == NULL)) {
- nxt_mp_release(task->thread->engine->mem_pool, b);
+ mp = task->thread->engine->mem_pool;
+ nxt_mp_free(mp, b);
+ nxt_mp_release(mp);
return NULL;
}