nxt_buf_pool.c (65:10688b89aa16) nxt_buf_pool.c (122:d18727e877c6)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

142 }
143
144 if (bp->destroy) {
145
146 if (b == bp->current) {
147 bp->current = NULL;
148 }
149
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

142 }
143
144 if (bp->destroy) {
145
146 if (b == bp->current) {
147 bp->current = NULL;
148 }
149
150 if (!bp->mmap) {
151 nxt_mp_free(bp->mem_pool, b->mem.start);
152 }
153
154 nxt_buf_free(bp->mem_pool, b);
155
156 return;
157 }
158
159 if (bp->mmap) {
160 b->mem.pos = NULL;
161 b->mem.free = NULL;

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

171 bp->free = b;
172 }
173}
174
175
176void
177nxt_buf_pool_destroy(nxt_buf_pool_t *bp)
178{
150 nxt_buf_free(bp->mem_pool, b);
151
152 return;
153 }
154
155 if (bp->mmap) {
156 b->mem.pos = NULL;
157 b->mem.free = NULL;

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

167 bp->free = b;
168 }
169}
170
171
172void
173nxt_buf_pool_destroy(nxt_buf_pool_t *bp)
174{
179 u_char *p;
180 nxt_buf_t *b;
181
182 bp->destroy = 1;
183
184 for (b = bp->free; b != NULL; b = b->next) {
175 nxt_buf_t *b;
176
177 bp->destroy = 1;
178
179 for (b = bp->free; b != NULL; b = b->next) {
185 p = b->mem.start;
186 nxt_buf_free(bp->mem_pool, b);
180 nxt_buf_free(bp->mem_pool, b);
187 nxt_mp_free(bp->mem_pool, p);
188 }
189
190 bp->free = b; /* NULL */
191}
181 }
182
183 bp->free = b; /* NULL */
184}