Lines Matching refs:entry

58     struct block_allocator_queue_entry entry[BLOCK_ALLOCATOR_QUEUE_LEN];  member
71 assert(q->head < countof(q->entry)); in block_allocator_queue_empty()
72 assert(q->tail < countof(q->entry)); in block_allocator_queue_empty()
85 return (q->tail + countof(q->entry) - q->head) % countof(q->entry); in block_allocator_queue_count()
100 assert(q->head < countof(q->entry)); in block_allocator_queue_find()
101 assert(q->tail < countof(q->entry)); in block_allocator_queue_find()
103 for (i = q->head; i != q->tail; i = (i + 1) % countof(q->entry)) { in block_allocator_queue_find()
104 if (q->entry[i].removed) { in block_allocator_queue_find()
107 if (block == q->entry[i].block) { in block_allocator_queue_find()
123 unsigned int new_tail = (q->tail + 1) % countof(q->entry); in block_allocator_queue_add_removed()
124 q->entry[q->tail].removed = true; in block_allocator_queue_add_removed()
147 assert(index < countof(q->entry)); in block_allocator_queue_add()
148 assert(q->entry[index].tmp == is_tmp); in block_allocator_queue_add()
149 assert(q->entry[index].free != is_free); in block_allocator_queue_add()
151 q->entry[index].removed = true; in block_allocator_queue_add()
160 new_tail = (q->tail + 1) % countof(q->entry); in block_allocator_queue_add()
162 assert(q->head < countof(q->entry)); in block_allocator_queue_add()
163 assert(q->tail < countof(q->entry)); in block_allocator_queue_add()
164 assert(new_tail < countof(q->entry)); in block_allocator_queue_add()
167 q->entry[q->tail].block = block; in block_allocator_queue_add()
168 assert(q->entry[q->tail].block == block); in block_allocator_queue_add()
169 q->entry[q->tail].tmp = is_tmp; in block_allocator_queue_add()
170 q->entry[q->tail].free = is_free; in block_allocator_queue_add()
171 q->entry[q->tail].removed = false; in block_allocator_queue_add()
187 return q->entry[q->head]; in block_allocator_queue_peek_head()
197 struct block_allocator_queue_entry entry) { in block_allocator_queue_remove_head() argument
198 assert(block_allocator_queue_peek_head(q).block == entry.block); in block_allocator_queue_remove_head()
201 q->head = (q->head + 1) % countof(q->entry); in block_allocator_queue_remove_head()
221 if (q->entry[index].free) { in block_allocator_queue_find_free_block()
524 return index >= 0 && block_allocator_queue.entry[index].tmp == is_tmp && in block_allocator_allocation_queued()
525 !block_allocator_queue.entry[index].free; in block_allocator_allocation_queued()
533 struct block_allocator_queue_entry entry; in block_allocator_process_queue() local
543 entry = block_allocator_queue_peek_head(&block_allocator_queue); in block_allocator_process_queue()
545 (data_block_t)entry.block, entry.tmp, entry.free, in block_allocator_process_queue()
546 entry.removed); in block_allocator_process_queue()
547 if (entry.removed) { in block_allocator_process_queue()
548 } else if (entry.free) { in block_allocator_process_queue()
549 block_allocator_add_free(tr, entry.block, entry.tmp); in block_allocator_process_queue()
551 block_allocator_add_allocated(tr, entry.block, entry.tmp); in block_allocator_process_queue()
553 block_allocator_queue_remove_head(&block_allocator_queue, entry); in block_allocator_process_queue()