diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-06-23 19:20:04 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-06-23 19:20:04 +0300 |
commit | 0cd95216877587d053341f52aa4b16362eccf173 (patch) | |
tree | 274b969a8f940845acb4710bcba05b7b2e5fa0fa /src/nxt_port_memory.h | |
parent | b13cdb0faae250e6aa8c9e46be03e3162f7de27d (diff) | |
download | unit-0cd95216877587d053341f52aa4b16362eccf173.tar.gz unit-0cd95216877587d053341f52aa4b16362eccf173.tar.bz2 |
Store pointer to shared memory start in buf->parent.
nxt_port_mmap_t stored in arrays and it is unsafe to store
pointer to array element.
Shared memory structures and macros moved to separate header
file to be used by GO package.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_port_memory.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nxt_port_memory.h b/src/nxt_port_memory.h index 9ad4e2a4..379201d0 100644 --- a/src/nxt_port_memory.h +++ b/src/nxt_port_memory.h @@ -1,7 +1,13 @@ +/* + * Copyright (C) Max Romanov + * Copyright (C) NGINX, Inc. + */ + #ifndef _NXT_PORT_MEMORY_H_INCLUDED_ #define _NXT_PORT_MEMORY_H_INCLUDED_ + #define PORT_MMAP_MIN_SIZE (3 * sizeof(uint32_t)) typedef struct nxt_port_mmap_header_s nxt_port_mmap_header_t; @@ -19,7 +25,10 @@ nxt_port_mmap_destroy(nxt_port_mmap_t *port_mmap); nxt_buf_t * nxt_port_mmap_get_buf(nxt_task_t *task, nxt_port_t *port, size_t size); -nxt_port_mmap_t * +nxt_int_t nxt_port_mmap_increase_buf(nxt_task_t *task, nxt_buf_t *b, + size_t size); + +nxt_port_mmap_header_t * nxt_port_incoming_port_mmap(nxt_task_t *task, nxt_process_t *process, nxt_fd_t fd); @@ -47,4 +56,5 @@ typedef enum nxt_port_method_e nxt_port_method_t; nxt_port_method_t nxt_port_mmap_get_method(nxt_task_t *task, nxt_port_t *port, nxt_buf_t *b); + #endif /* _NXT_PORT_MEMORY_H_INCLUDED_ */ |