• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/bulk_transfer/

Lines Matching refs:alloc

28  * @param alloc         pointer to an unused allocator handle
33 errval_t bulk_alloc_init(struct bulk_allocator *alloc,
38 assert(alloc);
52 err = bulk_pool_alloc(&alloc->pool, buffer_count, buffer_size);
69 err = frame_alloc(&alloc->pool->pool_cap, pool_size, &ret_size);
81 alloc->pool->trust = constraints->trust;
89 err = bulk_pool_map(alloc->pool);
95 alloc->mngs = calloc(buffer_count, sizeof(*alloc->mngs));
97 struct bulk_buffer *buf = alloc->pool->buffers[i];
99 struct bulk_buffer_mng *le = alloc->mngs + i;
101 le->next = alloc->free_buffers;
102 alloc->free_buffers = le;
104 alloc->num_free = buffer_count;
113 * @param alloc an unused allocator handle
117 errval_t bulk_alloc_init_from_cap(struct bulk_allocator *alloc,
128 * @param alloc handle to a bulk allocator to be freed
130 errval_t bulk_alloc_free(struct bulk_allocator *alloc)
139 assert(alloc->num_free == 1);
141 struct bulk_buffer *buf = bulk_alloc_new_buffer(alloc);
143 buf = alloc->pool->buffers[4];
221 * @param alloc the allocator handle to allocate the buffer from
227 struct bulk_buffer *bulk_alloc_new_buffer(struct bulk_allocator *alloc)
229 assert(alloc);
231 if (alloc->num_free == 0) {
235 struct bulk_buffer *buf = alloc->free_buffers->buffer;
236 alloc->free_buffers = alloc->free_buffers->next;
237 alloc->num_free--;
251 * @param alloc the allocator to hand the buffer back
254 errval_t bulk_alloc_return_buffer(struct bulk_allocator *alloc,
257 assert(alloc);
264 if (buffer->pool != alloc->pool) {
269 struct bulk_buffer_mng *bm = alloc->mngs + buffer->bufferid;
271 bm->next = alloc->free_buffers;
272 alloc->free_buffers = bm;
273 alloc->num_free++;