nxt_port_memory.h (365:28b2a468be43) nxt_port_memory.h (423:449f2a9c5e62)
1
2/*
3 * Copyright (C) Max Romanov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PORT_MEMORY_H_INCLUDED_
8#define _NXT_PORT_MEMORY_H_INCLUDED_
9
10
11#define PORT_MMAP_MIN_SIZE (3 * sizeof(uint32_t))
12
13typedef struct nxt_port_mmap_header_s nxt_port_mmap_header_t;
14typedef struct nxt_port_mmap_handler_s nxt_port_mmap_handler_t;
15
16void nxt_port_mmaps_destroy(nxt_port_mmaps_t *port_mmaps, nxt_bool_t free_elts);
17
1
2/*
3 * Copyright (C) Max Romanov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_PORT_MEMORY_H_INCLUDED_
8#define _NXT_PORT_MEMORY_H_INCLUDED_
9
10
11#define PORT_MMAP_MIN_SIZE (3 * sizeof(uint32_t))
12
13typedef struct nxt_port_mmap_header_s nxt_port_mmap_header_t;
14typedef struct nxt_port_mmap_handler_s nxt_port_mmap_handler_t;
15
16void nxt_port_mmaps_destroy(nxt_port_mmaps_t *port_mmaps, nxt_bool_t free_elts);
17
18typedef struct nxt_port_mmap_tracking_s nxt_port_mmap_tracking_t;
19
20struct nxt_port_mmap_tracking_s {
21 void *mmap_handler;
22 nxt_atomic_t *tracking;
23};
24
25nxt_int_t
26nxt_port_mmap_get_tracking(nxt_task_t *task, nxt_port_t *port,
27 nxt_port_mmap_tracking_t *tracking, uint32_t stream);
28
29nxt_bool_t
30nxt_port_mmap_tracking_cancel(nxt_task_t *task,
31 nxt_port_mmap_tracking_t *tracking, uint32_t stream);
32
33nxt_int_t
34nxt_port_mmap_tracking_write(uint32_t *buf, nxt_port_mmap_tracking_t *t);
35
36nxt_bool_t
37nxt_port_mmap_tracking_read(nxt_task_t *task, nxt_port_recv_msg_t *msg);
38
18/*
19 * Allocates nxt_but_t structure from port's mem_pool, assigns this buf 'mem'
20 * pointers to first available shared mem bucket(s). 'size' used as a hint to
21 * acquire several successive buckets if possible.
22 *
23 * This function assumes that current thread operates the 'port' exclusively.
24 */
25nxt_buf_t *

--- 6 unchanged lines hidden (view full) ---

32nxt_port_incoming_port_mmap(nxt_task_t *task, nxt_process_t *process,
33 nxt_fd_t fd);
34
35void
36nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port,
37 nxt_port_send_msg_t *msg, nxt_sendbuf_coalesce_t *sb);
38
39void
39/*
40 * Allocates nxt_but_t structure from port's mem_pool, assigns this buf 'mem'
41 * pointers to first available shared mem bucket(s). 'size' used as a hint to
42 * acquire several successive buckets if possible.
43 *
44 * This function assumes that current thread operates the 'port' exclusively.
45 */
46nxt_buf_t *

--- 6 unchanged lines hidden (view full) ---

53nxt_port_incoming_port_mmap(nxt_task_t *task, nxt_process_t *process,
54 nxt_fd_t fd);
55
56void
57nxt_port_mmap_write(nxt_task_t *task, nxt_port_t *port,
58 nxt_port_send_msg_t *msg, nxt_sendbuf_coalesce_t *sb);
59
60void
40nxt_port_mmap_read(nxt_task_t *task, nxt_port_t *port,
41 nxt_port_recv_msg_t *msg);
61nxt_port_mmap_read(nxt_task_t *task, nxt_port_recv_msg_t *msg);
42
43enum nxt_port_method_e {
44 NXT_PORT_METHOD_ANY = 0,
45 NXT_PORT_METHOD_PLAIN,
46 NXT_PORT_METHOD_MMAP
47};
48
49typedef enum nxt_port_method_e nxt_port_method_t;
50
51nxt_port_method_t
52nxt_port_mmap_get_method(nxt_task_t *task, nxt_port_t *port, nxt_buf_t *b);
53
54
55#endif /* _NXT_PORT_MEMORY_H_INCLUDED_ */
62
63enum nxt_port_method_e {
64 NXT_PORT_METHOD_ANY = 0,
65 NXT_PORT_METHOD_PLAIN,
66 NXT_PORT_METHOD_MMAP
67};
68
69typedef enum nxt_port_method_e nxt_port_method_t;
70
71nxt_port_method_t
72nxt_port_mmap_get_method(nxt_task_t *task, nxt_port_t *port, nxt_buf_t *b);
73
74
75#endif /* _NXT_PORT_MEMORY_H_INCLUDED_ */