Mercurial > hg > Game > Cerium
view TaskManager/Cell/CellTaskListInfo.cc @ 808:3c404a32719c draft
TaskListInfo version
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 22 May 2010 22:32:41 +0900 |
parents | 30dd8a3deb4a |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include "CellTaskListInfo.h" #define NEXT_ADDR(addr, size) \ (TaskListPtr)((memaddr)(addr) + (size)) int TaskListInfo::extend_pool(int num) { TaskListPtr q; int unit_size; unit_size = (ROUND_UP_ALIGN(sizeof(TaskList), DEFAULT_ALIGNMENT)); posix_memalign((void**)&q, DEFAULT_ALIGNMENT, unit_size*(num+1)); // First Queue is previous pool q->waiter = waiter; waiter = q; q++; /* Connect all free queue in the pool */ TaskListPtr p = q; for (; num-- > 0; p++) { p->waiter = NULL; taskListPool.addLast(p); } return 0; } /* end */