From 497faf1b9abb188cab40c389a9e6221add5dd496 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Thu, 28 Dec 2017 16:01:06 +0300 Subject: Changed nxt_mp_retain() and nxt_mp_release() interfaces. --- src/nxt_buf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nxt_buf.c') 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); -- cgit