diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-10-04 14:58:13 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-10-04 14:58:13 +0300 |
commit | 414d508e04d26ebef0e3e1ba4ed518b11d3af1a0 (patch) | |
tree | cb580219c1a313021e8c56f3a1abed9dfe1b15f0 /src/nxt_port_memory.c | |
parent | ba311997866a4c2ef6ceeaac846832a85bd86f17 (diff) | |
download | unit-414d508e04d26ebef0e3e1ba4ed518b11d3af1a0.tar.gz unit-414d508e04d26ebef0e3e1ba4ed518b11d3af1a0.tar.bz2 |
Using engine memiory pool for port write allocations.
To allow use port from different threads, the first step is to avoid using
port's memory pool for temporary allocations required to send data through
the port. Including but not limited by:
- buffers for data;
- send message structures;
- new mmap fd notifications;
It is still safe to use port memory pool for incoming buffers allocations
because recieve operation bound to single thread.
Diffstat (limited to 'src/nxt_port_memory.c')
-rw-r--r-- | src/nxt_port_memory.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_port_memory.c b/src/nxt_port_memory.c index ec4bbdf7..677421e3 100644 --- a/src/nxt_port_memory.c +++ b/src/nxt_port_memory.c @@ -426,7 +426,7 @@ nxt_port_mmap_get_buf(nxt_task_t *task, nxt_port_t *port, size_t size) nxt_debug(task, "request %z bytes shm buffer", size); - b = nxt_buf_mem_ts_alloc(task, port->mem_pool, 0); + b = nxt_buf_mem_ts_alloc(task, task->thread->engine->mem_pool, 0); if (nxt_slow_path(b == NULL)) { return NULL; } @@ -436,7 +436,7 @@ nxt_port_mmap_get_buf(nxt_task_t *task, nxt_port_t *port, size_t size) hdr = nxt_port_mmap_get(task, port, &c, size); if (nxt_slow_path(hdr == NULL)) { - nxt_mp_release(port->mem_pool, b); + nxt_mp_release(task->thread->engine->mem_pool, b); return NULL; } |