Mercurial > hg > Members > kono > Cerium
diff TaskManager/kernel/ppe/TaskQueueInfo.cc @ 109:5c194c71eca8
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | 588ab5f0e659 |
children | 5bda98b0b56d |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/TaskQueueInfo.cc Wed Nov 12 17:29:35 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskQueueInfo.cc Wed Nov 12 17:39:33 2008 +0900 @@ -21,9 +21,6 @@ { TaskQueuePtr q = NULL; - static int i = 0; - printf("extend %d\n", ++i); - q = (TaskQueuePtr)malloc(sizeof(TaskQueue)*(num+1)); if (q == NULL) { @@ -43,10 +40,10 @@ } TaskQueuePtr -TaskQueueInfo::create(HTaskPtr task) +TaskQueueInfo::create(TaskPtr task) { TaskQueuePtr q; - + if (freeTaskQueue == NULL) { extend_pool(100); } @@ -71,25 +68,21 @@ void TaskQueueInfo::destroy(void) { - TaskQueuePtr q; + TaskQueuePtr q, tmp; +#if 1 + q = taskQueuePool; + while (q) { + tmp = q->next; + free(q); + q = tmp; + } +#else for (q = taskQueuePool; q; q = q->next) { free(q); } +#endif freeTaskQueue = taskQueuePool = NULL; -} -TaskQueuePtr -TaskQueueInfo::append(TaskQueuePtr list, TaskQueuePtr q) -{ - TaskQueuePtr p = list; - - if (!p) { - return q; - } else { - while(p->next) p = p->next; - p->next = q; - return list; - } }