summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_buf.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2019-11-14 16:39:48 +0300
committerIgor Sysoev <igor@sysoev.ru>2019-11-14 16:39:48 +0300
commit1ec63537334e8765cd2d8e43dbca35340aa68777 (patch)
tree1a97e9f749b5243a114370ab211c5466ceca9910 /src/nxt_buf.c
parent07c007af57501dc656b94476cbca41234dc077d6 (diff)
downloadunit-1ec63537334e8765cd2d8e43dbca35340aa68777.tar.gz
unit-1ec63537334e8765cd2d8e43dbca35340aa68777.tar.bz2
Introduced event engine memory buffers.
Diffstat (limited to '')
-rw-r--r--src/nxt_buf.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nxt_buf.c b/src/nxt_buf.c
index 91846e4d..2d52efca 100644
--- a/src/nxt_buf.c
+++ b/src/nxt_buf.c
@@ -207,6 +207,13 @@ nxt_buf_completion(nxt_task_t *task, void *obj, void *data)
mp = b->data;
nxt_mp_free(mp, b);
+ nxt_buf_parent_completion(task, parent);
+}
+
+
+void
+nxt_buf_parent_completion(nxt_task_t *task, nxt_buf_t *parent)
+{
if (parent != NULL) {
nxt_debug(task, "parent retain:%uD", parent->retain);
@@ -272,17 +279,7 @@ nxt_buf_ts_completion(nxt_task_t *task, void *obj, void *data)
nxt_mp_free(mp, b);
nxt_mp_release(mp);
- if (parent != NULL) {
- nxt_debug(task, "parent retain:%uD", parent->retain);
-
- parent->retain--;
-
- if (parent->retain == 0) {
- parent->mem.pos = parent->mem.free;
-
- parent->completion_handler(task, parent, parent->parent);
- }
- }
+ nxt_buf_parent_completion(task, parent);
}