Mercurial > hg > Game > Cerium
view TaskManager/Cell/CellHTaskInfo.cc @ 421:6094dfd1f08c draft
comment
author | game@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 24 Sep 2009 12:35:32 +0900 |
parents | 028ffc9c0375 |
children | d6245cb38028 |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include "CellHTaskInfo.h" int CellHTaskInfo::extend_pool(int num) { HTaskPtr q = NULL; q = (HTaskPtr)malloc(sizeof(HTask)*(num+1)); if (q == NULL) { return -1; } q->next = htaskPool; htaskPool = q; /* Connect all free queue in the pool */ for (q = htaskPool + 1; --num > 0; q++) { q->next = q + 1; posix_memalign((void**)&q->inData, DEFAULT_ALIGNMENT, sizeof(ListData)); posix_memalign((void**)&q->outData, DEFAULT_ALIGNMENT, sizeof(ListData)); } q->next = freeHTask; posix_memalign((void**)&q->inData, DEFAULT_ALIGNMENT, sizeof(ListData)); posix_memalign((void**)&q->outData, DEFAULT_ALIGNMENT, sizeof(ListData)); freeHTask = htaskPool + 1; return 0; }