Lines Matching refs:mem
149 if (b->is_port_mmap_sent && b->mem.pos > b->mem.start) { in nxt_port_mmap_buf_completion()
154 p = b->mem.pos - 1; in nxt_port_mmap_buf_completion()
159 p = b->mem.start; in nxt_port_mmap_buf_completion()
163 nxt_port_mmap_free_junk(p, b->mem.end - p); 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()
169 while (p < b->mem.end) { in nxt_port_mmap_buf_completion()
207 void *mem; in nxt_port_incoming_port_mmap() local
224 mem = nxt_mem_mmap(NULL, mmap_stat.st_size, in nxt_port_incoming_port_mmap()
227 if (nxt_slow_path(mem == MAP_FAILED)) { in nxt_port_incoming_port_mmap()
233 hdr = mem; in nxt_port_incoming_port_mmap()
242 nxt_mem_munmap(mem, PORT_MMAP_SIZE); in nxt_port_incoming_port_mmap()
251 nxt_mem_munmap(mem, PORT_MMAP_SIZE); in nxt_port_incoming_port_mmap()
265 nxt_mem_munmap(mem, PORT_MMAP_SIZE); in nxt_port_incoming_port_mmap()
290 void *mem; in nxt_port_new_port_mmap() local
318 mem = nxt_mem_mmap(NULL, PORT_MMAP_SIZE, PROT_READ | PROT_WRITE, in nxt_port_new_port_mmap()
321 if (nxt_slow_path(mem == MAP_FAILED)) { in nxt_port_new_port_mmap()
326 mmap_handler->hdr = mem; in nxt_port_new_port_mmap()
584 b->mem.start = nxt_port_mmap_chunk_start(hdr, c); in nxt_port_mmap_get_buf()
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()
614 free_size = nxt_buf_mem_free_size(&b->mem); in nxt_port_mmap_increase_buf()
623 start = nxt_port_mmap_chunk_id(hdr, b->mem.end); in nxt_port_mmap_increase_buf()
656 b->mem.end += PORT_MMAP_CHUNK_SIZE * (c - start); in nxt_port_mmap_increase_buf()
694 b->mem.start = nxt_port_mmap_chunk_start(hdr, mmap_msg->chunk_id); in nxt_port_mmap_get_incoming_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()
703 b, b->mem.start, b->mem.end - b->mem.start, in nxt_port_mmap_get_incoming_buf()
732 while (bmem && sb->iobuf[i].iov_base != bmem->mem.pos) { in nxt_port_mmap_write()
747 mmap_msg->chunk_id = nxt_port_mmap_chunk_id(hdr, bmem->mem.pos); in nxt_port_mmap_write()
775 mmap_msg = (nxt_port_mmap_msg_t *) b->mem.pos; in nxt_port_mmap_read()
776 end = (nxt_port_mmap_msg_t *) b->mem.free; in nxt_port_mmap_read()
797 b->mem.pos += sizeof(nxt_port_mmap_msg_t); in nxt_port_mmap_read()