Lines Matching refs:pool

176 void Curl_bufcp_init(struct bufc_pool *pool,  in Curl_bufcp_init()  argument
181 memset(pool, 0, sizeof(*pool)); in Curl_bufcp_init()
182 pool->chunk_size = chunk_size; in Curl_bufcp_init()
183 pool->spare_max = spare_max; in Curl_bufcp_init()
186 static CURLcode bufcp_take(struct bufc_pool *pool, in bufcp_take() argument
191 if(pool->spare) { in bufcp_take()
192 chunk = pool->spare; in bufcp_take()
193 pool->spare = chunk->next; in bufcp_take()
194 --pool->spare_count; in bufcp_take()
200 chunk = calloc(1, sizeof(*chunk) + pool->chunk_size); in bufcp_take()
205 chunk->dlen = pool->chunk_size; in bufcp_take()
210 static void bufcp_put(struct bufc_pool *pool, in bufcp_put() argument
213 if(pool->spare_count >= pool->spare_max) { in bufcp_put()
218 chunk->next = pool->spare; in bufcp_put()
219 pool->spare = chunk; in bufcp_put()
220 ++pool->spare_count; in bufcp_put()
224 void Curl_bufcp_free(struct bufc_pool *pool) in Curl_bufcp_free() argument
226 chunk_list_free(&pool->spare); in Curl_bufcp_free()
227 pool->spare_count = 0; in Curl_bufcp_free()
230 static void bufq_init(struct bufq *q, struct bufc_pool *pool, in bufq_init() argument
238 q->pool = pool; in bufq_init()
253 void Curl_bufq_initp(struct bufq *q, struct bufc_pool *pool, in Curl_bufq_initp() argument
256 bufq_init(q, pool, pool->chunk_size, max_chunks, opts); in Curl_bufq_initp()
339 if(q->pool) { in get_spare()
340 if(bufcp_take(q->pool, &chunk)) in get_spare()
364 if(q->pool) { in prune_head()
365 bufcp_put(q->pool, chunk); in prune_head()
407 if(q->pool) { in prune_tail()
408 bufcp_put(q->pool, chunk); in prune_tail()