Lines Matching refs:pool

1419     struct pool *pool;      // pool to return to  member
1424 struct pool { struct
1435 local void new_pool(struct pool *pool, size_t size, int limit) { in new_pool() argument
1436 pool->have = new_lock(0); in new_pool()
1437 pool->head = NULL; in new_pool()
1438 pool->size = size; in new_pool()
1439 pool->limit = limit; in new_pool()
1440 pool->made = 0; in new_pool()
1445 local struct space *get_space(struct pool *pool) { in get_space() argument
1449 possess(pool->have); in get_space()
1450 if (pool->limit == 0) in get_space()
1451 wait_for(pool->have, NOT_TO_BE, 0); in get_space()
1454 if (pool->head != NULL) { in get_space()
1455 space = pool->head; in get_space()
1456 pool->head = space->next; in get_space()
1457 twist(pool->have, BY, -1); // one less in pool in get_space()
1465 assert(pool->limit != 0); in get_space()
1466 if (pool->limit > 0) in get_space()
1467 pool->limit--; in get_space()
1468 pool->made++; in get_space()
1469 release(pool->have); in get_space()
1472 space->buf = alloc(NULL, pool->size); in get_space()
1473 space->size = pool->size; in get_space()
1475 space->pool = pool; // remember the pool this belongs to in get_space()
1507 struct pool *pool; in drop_space() local
1516 pool = space->pool; in drop_space()
1517 possess(pool->have); in drop_space()
1518 space->next = pool->head; in drop_space()
1519 pool->head = space; in drop_space()
1520 twist(pool->have, BY, +1); in drop_space()
1526 local int free_pool(struct pool *pool) { in free_pool() argument
1530 possess(pool->have); in free_pool()
1532 while ((space = pool->head) != NULL) { in free_pool()
1533 pool->head = space->next; in free_pool()
1539 assert(count == pool->made); in free_pool()
1540 release(pool->have); in free_pool()
1541 free_lock(pool->have); in free_pool()
1546 local struct pool in_pool;
1547 local struct pool out_pool;
1548 local struct pool dict_pool;
1549 local struct pool lens_pool;