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_buf.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_buf.c')
-rw-r--r-- | src/nxt_buf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_buf.c b/src/nxt_buf.c index 7bc983a3..36a1dcd0 100644 --- a/src/nxt_buf.c +++ b/src/nxt_buf.c @@ -59,11 +59,13 @@ nxt_buf_mem_ts_alloc(nxt_task_t *task, nxt_mp_t *mp, size_t size) nxt_buf_t *b; nxt_buf_ts_t *ts; - b = nxt_mp_retain(mp, NXT_BUF_MEM_SIZE + sizeof(nxt_buf_ts_t) + size); + b = nxt_mp_alloc(mp, NXT_BUF_MEM_SIZE + sizeof(nxt_buf_ts_t) + size); if (nxt_slow_path(b == NULL)) { return NULL; } + nxt_mp_retain(mp); + nxt_memzero(b, NXT_BUF_MEM_SIZE + sizeof(nxt_buf_ts_t)); b->data = mp; @@ -284,7 +286,8 @@ nxt_buf_ts_completion(nxt_task_t *task, void *obj, void *data) #endif mp = b->data; - nxt_mp_release(mp, b); + nxt_mp_free(mp, b); + nxt_mp_release(mp); if (parent != NULL) { nxt_debug(task, "parent retain:%uD", parent->retain); |