Queue/Definition: Difference between revisions

Line 715:
if (q->tail >= q->alloc) q->tail = 0;
q->buf[q->tail++] = n;
// Previous code was (q->tail == q->head) array fails to resize when you use test
// casesFixed otherbug thanwhere theit providedfailed one,to this fixes itresizes
if (q->tail == q->alloc) { /* needs more room */
q->buf = realloc(q->buf, sizeof(DATA) * q->alloc * 2);