Home
last modified time | relevance | path

Searched refs:mem (Results 1 – 25 of 36) sorted by relevance

12

/unit/src/
H A Dnxt_buf.c47 b->mem.pos = b->mem.start; in nxt_buf_mem_alloc()
48 b->mem.free = b->mem.start; in nxt_buf_mem_alloc()
49 b->mem.end = b->mem.start + size; in nxt_buf_mem_alloc()
78 b->mem.pos = b->mem.start; in nxt_buf_mem_ts_alloc()
79 b->mem.free = b->mem.start; in nxt_buf_mem_ts_alloc()
80 b->mem.end = b->mem.start + size; in nxt_buf_mem_ts_alloc()
113 b->mem.pos = b->mem.start; in nxt_buf_file_alloc()
114 b->mem.free = b->mem.start; in nxt_buf_file_alloc()
115 b->mem.end = b->mem.start + size; in nxt_buf_file_alloc()
187 length += b->mem.free - b->mem.pos; in nxt_buf_chain_length()
[all …]
H A Dnxt_recvbuf.c26 size = b->mem.end - b->mem.free; in nxt_recvbuf_mem_coalesce()
28 if (b->mem.free != last) { in nxt_recvbuf_mem_coalesce()
34 nxt_iobuf_set(&rb->iobuf[n], b->mem.free, size); in nxt_recvbuf_mem_coalesce()
45 last = b->mem.end; in nxt_recvbuf_mem_coalesce()
69 size = b->mem.end - b->mem.free; in nxt_recvbuf_update()
72 b->mem.free += sent; in nxt_recvbuf_update()
76 b->mem.free = b->mem.end; in nxt_recvbuf_update()
H A Dnxt_http_websocket.c50 wsh = (nxt_websocket_header_t *) r->ws_frame->mem.pos; in nxt_http_websocket_client()
63 used_size = nxt_buf_mem_used_size(&b->mem); in nxt_http_websocket_client()
79 buf->mem.free = nxt_cpymem(buf->mem.free, b->mem.pos, in nxt_http_websocket_client()
83 b->mem.pos += chunk_copy_size; in nxt_http_websocket_client()
91 if (nxt_buf_mem_used_size(&b->mem) == 0) { in nxt_http_websocket_client()
112 used_size = nxt_buf_mem_used_size(&b->mem); in nxt_http_websocket_client()
115 nxt_memmove(b->mem.start, b->mem.pos, used_size); in nxt_http_websocket_client()
117 b->mem.pos = b->mem.start; in nxt_http_websocket_client()
118 b->mem.free = b->mem.start + used_size; in nxt_http_websocket_client()
H A Dnxt_conn_proxy.c405 wb->mem.pos = rb->mem.pos; in nxt_conn_proxy_read_process()
406 wb->mem.free = rb->mem.free; in nxt_conn_proxy_read_process()
407 wb->mem.start = rb->mem.pos; in nxt_conn_proxy_read_process()
408 wb->mem.end = rb->mem.free; in nxt_conn_proxy_read_process()
410 rb->mem.pos = rb->mem.free; in nxt_conn_proxy_read_process()
483 prev->mem.free = b->mem.end; in nxt_conn_proxy_write_add()
484 prev->mem.end = b->mem.end; in nxt_conn_proxy_write_add()
598 rb->mem.pos = wb->mem.start; in nxt_conn_proxy_write_process()
601 rb->mem.end = wb->mem.pos; in nxt_conn_proxy_write_process()
603 wb->mem.start = wb->mem.pos; in nxt_conn_proxy_write_process()
[all …]
H A Dnxt_buf_pool.c17 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_mem_alloc()
57 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_file_alloc()
136 nxt_thread_log_debug("buf pool free: %p %p", b, b->mem.start); in nxt_buf_pool_free()
138 size = nxt_buf_mem_size(&b->mem); in nxt_buf_pool_free()
141 nxt_mem_unmap(b->mem.start, &b->mmap, size); in nxt_buf_pool_free()
156 b->mem.pos = NULL; in nxt_buf_pool_free()
157 b->mem.free = NULL; in nxt_buf_pool_free()
158 nxt_buf_mem_set_size(&b->mem, size); in nxt_buf_pool_free()
161 b->mem.pos = b->mem.start; in nxt_buf_pool_free()
162 b->mem.free = b->mem.start; in nxt_buf_pool_free()
H A Dnxt_port_memory.c149 if (b->is_port_mmap_sent && b->mem.pos > b->mem.start) { in nxt_port_mmap_buf_completion()
166 "%PI->%PI,%d,%d", b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_buf_completion()
233 hdr = mem; in nxt_port_incoming_port_mmap()
585 b->mem.pos = b->mem.start; in nxt_port_mmap_get_buf()
586 b->mem.free = b->mem.start; in nxt_port_mmap_get_buf()
587 b->mem.end = b->mem.start + nchunks * PORT_MMAP_CHUNK_SIZE; in nxt_port_mmap_get_buf()
590 b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_get_buf()
695 b->mem.pos = b->mem.start; in nxt_port_mmap_get_incoming_buf()
696 b->mem.free = b->mem.start + mmap_msg->size; in nxt_port_mmap_get_incoming_buf()
697 b->mem.end = b->mem.start + nchunks * PORT_MMAP_CHUNK_SIZE; in nxt_port_mmap_get_incoming_buf()
[all …]
H A Dnxt_stream_source.c311 b->mem.pos = in->mem.free; in nxt_stream_source_process_buffers()
312 b->mem.start = in->mem.free; in nxt_stream_source_process_buffers()
317 in->mem.free += nbytes; in nxt_stream_source_process_buffers()
319 b->mem.free = in->mem.free; in nxt_stream_source_process_buffers()
320 b->mem.end = in->mem.free; in nxt_stream_source_process_buffers()
325 in->mem.free = in->mem.end; in nxt_stream_source_process_buffers()
327 b->mem.free = in->mem.free; in nxt_stream_source_process_buffers()
328 b->mem.end = in->mem.free; in nxt_stream_source_process_buffers()
361 parent->mem.pos = b->mem.pos; in nxt_stream_source_buf_completion()
367 parent->mem.pos = parent->mem.start; in nxt_stream_source_buf_completion()
[all …]
H A Dnxt_fastcgi_record_parse.c57 fp->pos = b->mem.pos; in nxt_fastcgi_record_parse()
59 while (fp->pos < b->mem.free) { in nxt_fastcgi_record_parse()
261 size = in->mem.free - p; in nxt_fastcgi_buffer()
268 in->mem.pos = p; in nxt_fastcgi_buffer()
283 b->mem.pos = p; in nxt_fastcgi_buffer()
284 b->mem.start = p; in nxt_fastcgi_buffer()
290 b->mem.free = p; in nxt_fastcgi_buffer()
291 b->mem.end = p; in nxt_fastcgi_buffer()
296 b->mem.free = in->mem.free; in nxt_fastcgi_buffer()
297 b->mem.end = in->mem.free; in nxt_fastcgi_buffer()
H A Dnxt_http_chunk_parse.c51 hcp->pos = b->mem.pos; in nxt_http_chunk_parse()
53 while (hcp->pos < b->mem.free) { in nxt_http_chunk_parse()
207 size = in->mem.free - p; in nxt_http_chunk_buffer()
222 b->mem.pos = p; in nxt_http_chunk_buffer()
223 b->mem.start = p; in nxt_http_chunk_buffer()
229 b->mem.free = p; in nxt_http_chunk_buffer()
230 b->mem.end = p; in nxt_http_chunk_buffer()
235 b->mem.free = in->mem.free; in nxt_http_chunk_buffer()
236 b->mem.end = in->mem.free; in nxt_http_chunk_buffer()
256 nxt_debug(task, "buf completion: %p %p", b, b->mem.start); in nxt_http_chunk_buf_completion()
H A Dnxt_h1proto_websocket.c150 nxt_memmove(in->mem.start, in->mem.pos, size); in nxt_h1p_websocket_frame_start()
152 in->mem.pos = in->mem.start; in nxt_h1p_websocket_frame_start()
153 in->mem.free = in->mem.start + size; in nxt_h1p_websocket_frame_start()
187 out->mem.start[0] = 0; in nxt_h1p_conn_ws_keepalive()
188 out->mem.start[1] = 0; in nxt_h1p_conn_ws_keepalive()
343 c->read->mem.end = c->read->mem.start + frame_size; in nxt_h1p_conn_ws_frame_header_read()
609 out->mem.start[0] = 0; in hxt_h1p_send_ws_error()
610 out->mem.start[1] = 0; in hxt_h1p_send_ws_error()
662 b->mem.pos += 2; in nxt_h1p_conn_ws_pong()
666 b->mem.pos += 4; in nxt_h1p_conn_ws_pong()
[all …]
H A Dnxt_fastcgi_source.c225 size = b->mem.end - b->mem.free; in nxt_fastcgi_request_create()
230 p = b->mem.free; in nxt_fastcgi_request_create()
270 b->mem.free = nxt_cpymem(b->mem.free, param.buf, len); in nxt_fastcgi_request_create()
285 if (b->mem.end - b->mem.free >= 16) { in nxt_fastcgi_request_create()
289 nxt_thread_log_debug("\"%*s\"", b->mem.free - b->mem.pos, in nxt_fastcgi_request_create()
302 nxt_memzero(b->mem.free, size); in nxt_fastcgi_request_create()
303 b->mem.free += size; in nxt_fastcgi_request_create()
307 if (b->mem.end - b->mem.free < 16) { in nxt_fastcgi_request_create()
308 nxt_thread_log_debug("\"%*s\"", b->mem.free - b->mem.pos, b->mem.pos); in nxt_fastcgi_request_create()
325 nxt_thread_log_debug("\"%*s\"", b->mem.free - b->mem.pos, b->mem.pos); in nxt_fastcgi_request_create()
[all …]
H A Dnxt_sendbuf.c39 size = b->mem.free - b->mem.pos; in nxt_sendbuf_mem_coalesce0()
51 if (b->mem.pos != last) { in nxt_sendbuf_mem_coalesce0()
57 iov[n].iov_base = b->mem.pos; in nxt_sendbuf_mem_coalesce0()
68 last = b->mem.pos + size; in nxt_sendbuf_mem_coalesce0()
109 size = b->mem.free - b->mem.pos; in nxt_sendbuf_mem_coalesce()
123 if (b->mem.pos != last) { in nxt_sendbuf_mem_coalesce()
142 last = b->mem.pos + size; in nxt_sendbuf_mem_coalesce()
218 size = nxt_buf_mem_used_size(&b->mem); in nxt_sendbuf_copy_coalesce()
307 size = b->mem.free - b->mem.pos; in nxt_sendbuf_copy()
352 b->mem.pos += sent; in nxt_sendbuf_update()
[all …]
H A Dnxt_http_source.c159 b->mem.free = nxt_http_source_copy(b->mem.free, &hs->u.request.copy, in nxt_http_source_request_create()
160 b->mem.end - b->mem.free); in nxt_http_source_request_create()
166 nxt_thread_log_debug("\"%*s\"", b->mem.free - b->mem.pos, in nxt_http_source_request_create()
167 b->mem.pos); in nxt_http_source_request_create()
180 nxt_thread_log_debug("\"%*s\"", b->mem.free - b->mem.pos, b->mem.pos); in nxt_http_source_request_create()
208 ret = nxt_http_status_parse(&hs->u.status_parse, &b->mem); in nxt_http_source_status_filter()
218 hs->u.status_parse.end - b->mem.start, b->mem.start); in nxt_http_source_status_filter()
250 if (b->parent->mem.pos == b->parent->mem.end) { in nxt_http_source_status_filter()
252 b->mem.pos - b->mem.start, b->mem.start); in nxt_http_source_status_filter()
464 if (nxt_buf_mem_used_size(&rest->mem) != 0) { in nxt_http_source_header_ready()
[all …]
H A Dnxt_controller.c608 b->mem.free = nxt_cpymem(b->mem.pos, &size, sizeof(size_t)); in nxt_controller_conf_send()
816 b->mem.free = nxt_cpymem(b->mem.free, c->read->mem.pos, preread); in nxt_controller_conn_read()
930 if (b->mem.pos != b->mem.free) { in nxt_controller_conn_write()
2109 b->mem.free = nxt_cpymem(b->mem.pos, &size, sizeof(size_t)); in nxt_controller_conf_store()
2242 body->mem.free = nxt_cpymem(body->mem.free, "\r\n", 2); in nxt_controller_response()
2262 b->mem.free = nxt_cpymem(b->mem.free, str.start, str.length); in nxt_controller_response()
2263 b->mem.free = nxt_cpymem(b->mem.free, status_line.start, in nxt_controller_response()
2270 b->mem.free = nxt_cpymem(b->mem.free, str.start, str.length); in nxt_controller_response()
2279 b->mem.free = nxt_cpymem(b->mem.free, str.start, str.length); in nxt_controller_response()
2281 b->mem.free = nxt_sprintf(b->mem.free, b->mem.end, "%uz", in nxt_controller_response()
[all …]
H A Dnxt_h1proto.c329 b->mem.free = b->mem.pos; in nxt_http_conn_test()
725 b->mem.free = nxt_cpymem(b->mem.pos, in->mem.pos, used); in nxt_h1p_header_buffer_test()
920 b->mem.pos = b->mem.start; in nxt_h1p_request_body_read()
921 b->mem.free = b->mem.start; in nxt_h1p_request_body_read()
957 b->mem.free = nxt_cpymem(b->mem.free, in->mem.pos, size); in nxt_h1p_request_body_read()
1053 if (b->mem.pos == b->mem.free) { in nxt_h1p_conn_request_body_read()
1055 b->mem.free = b->mem.start; in nxt_h1p_conn_request_body_read()
1062 b->mem.pos = b->mem.free; in nxt_h1p_conn_request_body_read()
1537 header->mem.free = nxt_sprintf(header->mem.free, header->mem.end, in nxt_h1p_chunk_create()
1819 in->mem.pos = in->mem.start; in nxt_h1p_keepalive()
[all …]
H A Dnxt_buf.h92 nxt_buf_mem_t mem; member
104 #define NXT_BUF_SYNC_SIZE offsetof(nxt_buf_t, mem.free)
117 ((b)->mem.pos != NULL)
211 nxt_buf_mem_used_size(&(b)->mem))
250 nxt_memcpy(b->mem.free, src, length); in nxt_buf_cpy()
251 b->mem.free += length; in nxt_buf_cpy()
H A Dnxt_job_file.c99 size = nxt_buf_mem_size(&jbf->buffer->mem); in nxt_job_file_open_and_read()
249 jbf->buffer->mem.pos = p; in nxt_job_file_mmap()
250 jbf->buffer->mem.free = end; in nxt_job_file_mmap()
251 jbf->buffer->mem.start = p; in nxt_job_file_mmap()
252 jbf->buffer->mem.end = end; in nxt_job_file_mmap()
280 n = nxt_file_read(&jbf->file, jbf->buffer->mem.free, size, jbf->offset); in nxt_job_file_read_data()
284 jbf->buffer->mem.free += n; in nxt_job_file_read_data()
H A Dnxt_http_error.c92 out->mem.free = nxt_sprintf(out->mem.pos, out->mem.end, error, in nxt_http_request_send_error_body()
H A Dnxt_main_process.c323 nxt_buf_mem_used_size(&msg->buf->mem), msg->buf->mem.pos); in nxt_main_data_handler()
330 void *mem; in nxt_main_new_port_handler() local
344 port->queue = mem; in nxt_main_new_port_handler()
405 nxt_debug(task, "main start prototype: %*s", b->mem.free - b->mem.pos, in nxt_main_start_process_handler()
406 b->mem.pos); in nxt_main_start_process_handler()
416 start = b->mem.pos; in nxt_main_start_process_handler()
671 buf->mem.free = nxt_cpymem(buf->mem.free, &pid, sizeof(nxt_pid_t)); in nxt_main_process_whoami_handler()
1071 out->mem.free = nxt_cpymem(out->mem.free, ls.start, size); in nxt_main_port_socket_handler()
1318 b->mem.free - b->mem.pos, b->mem.pos); in nxt_main_port_modules_handler()
1320 conf = nxt_conf_json_parse(mp, b->mem.pos, b->mem.free, NULL); in nxt_main_port_modules_handler()
[all …]
H A Dnxt_port.c244 b->mem.free += sizeof(nxt_port_msg_new_port_t); in nxt_port_send_port()
245 msg = (nxt_port_msg_new_port_t *) b->mem.pos; in nxt_port_send_port()
268 new_port_msg = (nxt_port_msg_new_port_t *) msg->buf->mem.pos; in nxt_port_new_port_handler()
398 b->mem.free = nxt_cpymem(b->mem.free, &slot, sizeof(nxt_uint_t)); in nxt_port_change_log_file()
418 slot = *(nxt_uint_t *) b->mem.pos; in nxt_port_change_log_file_handler()
444 dump_size = b->mem.free - b->mem.pos; in nxt_port_data_handler()
450 nxt_debug(task, "data: %*s", dump_size, b->mem.pos); in nxt_port_data_handler()
492 buf->mem.free = nxt_cpymem(buf->mem.free, &pid, sizeof(pid)); in nxt_port_remove_notify_others()
511 nxt_memcpy(&pid, buf->mem.pos, sizeof(nxt_pid_t)); in nxt_port_remove_pid_handler()
H A Dnxt_buf_pool.h48 && (bp)->current->mem.free < (bp)->current->mem.end))
H A Dnxt_cyassl.c361 ret = CyaSSL_read(ssltls->session, b->mem.free, in nxt_cyassl_conn_io_read()
362 b->mem.end - b->mem.free); in nxt_cyassl_conn_io_read()
367 c->socket.fd, b->mem.free, b->mem.end - b->mem.free, ret); in nxt_cyassl_conn_io_read()
371 b->mem.free += ret; in nxt_cyassl_conn_io_read()
383 c->socket.fd, b->mem.free, in nxt_cyassl_conn_io_read()
384 b->mem.end - b->mem.free); in nxt_cyassl_conn_io_read()
H A Dnxt_solaris_sendfilev.c122 pos = (uintptr_t) b->mem.pos; in nxt_solaris_buf_coalesce()
123 size = b->mem.free - b->mem.pos; in nxt_solaris_buf_coalesce()
H A Dnxt_gnutls.c490 n = gnutls_record_recv(ssltls->session, b->mem.free, in nxt_gnutls_conn_io_read()
491 b->mem.end - b->mem.free); in nxt_gnutls_conn_io_read()
494 c->socket.fd, b->mem.free, b->mem.end - b->mem.free, n); in nxt_gnutls_conn_io_read()
498 b->mem.free += n; in nxt_gnutls_conn_io_read()
514 c->socket.fd, b->mem.free, in nxt_gnutls_conn_io_read()
515 b->mem.end - b->mem.free); in nxt_gnutls_conn_io_read()
H A Dnxt_port_socket.c214 b->mem.pos = b->mem.free; in nxt_port_socket_write2()
277 size = nxt_buf_mem_used_size(&b->mem); in nxt_port_enqueue_buf()
280 nxt_memcpy(qbuf, b->mem.pos, size); in nxt_port_enqueue_buf()
291 mm->size = nxt_buf_mem_used_size(&b->mem); in nxt_port_enqueue_buf()
649 b->mem.pos += sent; in nxt_port_buf_completion()
660 b->mem.pos = b->mem.free; in nxt_port_buf_completion()
755 iov[1].iov_base = b->mem.pos; in nxt_port_read_handler()
907 iov[1].iov_base = b->mem.pos; in nxt_port_queue_read_handler()
1190 b->mem.free += msg->size; in nxt_port_read_msg_process()
1313 b->mem.pos = b->mem.start; in nxt_port_buf_alloc()
[all …]

12