Archived
1
0
Fork 0

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:
Henrik Hautakoski 2010-12-09 15:53:53 +01:00
parent 3110bbf761
commit f973e29668
2 changed files with 23 additions and 27 deletions

View file

@ -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]);
}