MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Queue_Enqueue

Function Queue_Enqueue

src/Queue.c:56–64  ·  view source on GitHub ↗

Appends an entry to the end of the queue, resizing if necessary. */

Source from the content-addressed store, hash-verified

54
55/* Appends an entry to the end of the queue, resizing if necessary. */
56void Queue_Enqueue(struct Queue* queue, void* item) {
57 if (queue->count == queue->capacity)
58 Queue_Resize(queue);
59
60 //queue->entries[queue->tail] = item;
61 Mem_Copy(queue->entries + queue->tail * queue->structSize, item, queue->structSize);
62 queue->tail = (queue->tail + 1) & queue->mask;
63 queue->count++;
64}
65
66/* Retrieves the entry from the front of the queue. */
67void* Queue_Dequeue(struct Queue* queue) {

Callers 4

FancyLighting.cFile · 0.85
CalcUnlightFunction · 0.85
CalcBlockChangeFunction · 0.85

Calls 2

Queue_ResizeFunction · 0.85
Mem_CopyFunction · 0.85

Tested by

no test coverage detected