src/queue.c: don't deallocate the last block when queue becomes empty.
always keep one block in the queue so that in situations when the queue becomes empty frequently. performance dosent blow up by calls to malloc/free.
This commit is contained in:
parent
3110bbf761
commit
f973e29668
2 changed files with 23 additions and 27 deletions
|
|
@ -16,9 +16,6 @@ int main() {
|
|||
for(i=0; i < 4; i++) {
|
||||
int *c = queue_dequeue(q);
|
||||
|
||||
if (c == NULL)
|
||||
continue;
|
||||
|
||||
assert(c == &map[i]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue