Lines Matching refs:b

13     nxt_buf_t  *b;  in nxt_buf_pool_mem_alloc()  local
15 b = bp->current; in nxt_buf_pool_mem_alloc()
17 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_mem_alloc()
21 b = bp->free; in nxt_buf_pool_mem_alloc()
23 if (b != NULL) { in nxt_buf_pool_mem_alloc()
24 bp->current = b; in nxt_buf_pool_mem_alloc()
25 bp->free = b->next; in nxt_buf_pool_mem_alloc()
26 b->next = NULL; in nxt_buf_pool_mem_alloc()
38 b = nxt_buf_mem_alloc(bp->mem_pool, size, bp->flags); in nxt_buf_pool_mem_alloc()
40 if (nxt_fast_path(b != NULL)) { in nxt_buf_pool_mem_alloc()
41 bp->current = b; in nxt_buf_pool_mem_alloc()
53 nxt_buf_t *b; in nxt_buf_pool_file_alloc() local
55 b = bp->current; in nxt_buf_pool_file_alloc()
57 if (b != NULL && b->mem.free < b->mem.end) { in nxt_buf_pool_file_alloc()
61 b = bp->free; in nxt_buf_pool_file_alloc()
63 if (b != NULL) { in nxt_buf_pool_file_alloc()
64 bp->current = b; in nxt_buf_pool_file_alloc()
65 bp->free = b->next; in nxt_buf_pool_file_alloc()
66 b->next = NULL; in nxt_buf_pool_file_alloc()
78 b = nxt_buf_file_alloc(bp->mem_pool, size, bp->flags); in nxt_buf_pool_file_alloc()
80 if (nxt_fast_path(b != NULL)) { in nxt_buf_pool_file_alloc()
81 bp->current = b; in nxt_buf_pool_file_alloc()
93 nxt_buf_t *b; in nxt_buf_pool_mmap_alloc() local
95 b = bp->current; in nxt_buf_pool_mmap_alloc()
97 if (b != NULL) { in nxt_buf_pool_mmap_alloc()
101 b = bp->free; in nxt_buf_pool_mmap_alloc()
103 if (b != NULL) { in nxt_buf_pool_mmap_alloc()
104 bp->current = b; in nxt_buf_pool_mmap_alloc()
105 bp->free = b->next; in nxt_buf_pool_mmap_alloc()
106 b->next = NULL; in nxt_buf_pool_mmap_alloc()
118 b = nxt_buf_mmap_alloc(bp->mem_pool, size); in nxt_buf_pool_mmap_alloc()
120 if (nxt_fast_path(b != NULL)) { in nxt_buf_pool_mmap_alloc()
122 bp->current = b; in nxt_buf_pool_mmap_alloc()
132 nxt_buf_pool_free(nxt_buf_pool_t *bp, nxt_buf_t *b) in nxt_buf_pool_free() argument
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()
146 if (b == bp->current) { in nxt_buf_pool_free()
150 nxt_buf_free(bp->mem_pool, b); 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()
165 if (b != bp->current) { in nxt_buf_pool_free()
166 b->next = bp->free; in nxt_buf_pool_free()
167 bp->free = b; in nxt_buf_pool_free()
175 nxt_buf_t *b, *n; in nxt_buf_pool_destroy() local
179 for (b = bp->free; b != NULL; b = n) { in nxt_buf_pool_destroy()
180 n = b->next; in nxt_buf_pool_destroy()
181 nxt_buf_free(bp->mem_pool, b); in nxt_buf_pool_destroy()
184 bp->free = b; /* NULL */ in nxt_buf_pool_destroy()