From ba0391577b06446307fa073f856f57748557e0dd Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 27 Jan 2017 11:35:11 +0300 Subject: Work queues refactoring. --- src/nxt_buf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nxt_buf.c') diff --git a/src/nxt_buf.c b/src/nxt_buf.c index 88444a3d..d2b6fe7a 100644 --- a/src/nxt_buf.c +++ b/src/nxt_buf.c @@ -10,6 +10,18 @@ static void nxt_buf_completion(nxt_task_t *task, void *obj, void *data); +void +nxt_buf_mem_init(nxt_buf_t *b, void *start, size_t size) +{ + b->size = NXT_BUF_MEM_SIZE; + + b->mem.start = start; + b->mem.pos = start; + b->mem.free = start; + b->mem.end = start + size; +} + + nxt_buf_t * nxt_buf_mem_alloc(nxt_mem_pool_t *mp, size_t size, nxt_uint_t flags) { -- cgit