Mercurial > hg > Game > Cerium
changeset 60:f50c74835a9b
*** empty log message ***
author | gongo |
---|---|
date | Sat, 16 Feb 2008 20:05:35 +0900 |
parents | 16f9f6251f49 |
children | 6bc72fde6615 |
files | TaskManager/Cell/CellBufferManager.cc TaskManager/Cell/CellTaskListInfo.cc TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Makefile.cell include/TaskManager/task.h |
diffstat | 5 files changed, 16 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellBufferManager.cc Sat Feb 16 19:57:23 2008 +0900 +++ b/TaskManager/Cell/CellBufferManager.cc Sat Feb 16 20:05:35 2008 +0900 @@ -4,7 +4,7 @@ #include "CellTaskListInfo.h" void -BufferManager::init(void) +CellBufferManager::init(void) { tlistImpl = new CellTaskListInfo; tqueueImpl = new TaskQueueInfo; @@ -23,7 +23,7 @@ #if 0 // 継承するかもしれないので保存 void -BufferManager::append_activeTask(HTaskPtr task) +CellBufferManager::append_activeTask(HTaskPtr task) { TaskQueuePtr q; @@ -32,7 +32,7 @@ } void -BufferManager::append_waitTask(HTaskPtr task) +CellBufferManager::append_waitTask(HTaskPtr task) { TaskQueuePtr q; @@ -41,7 +41,7 @@ } TaskListPtr -BufferManager::get_available_taskList(void) +CellBufferManager::get_available_taskList(void) { TaskListPtr list, q; @@ -59,7 +59,7 @@ } void -BufferManager::clear_taskList(void) +CellBufferManager::clear_taskList(void) { TaskListPtr p, p1;
--- a/TaskManager/Cell/CellTaskListInfo.cc Sat Feb 16 19:57:23 2008 +0900 +++ b/TaskManager/Cell/CellTaskListInfo.cc Sat Feb 16 20:05:35 2008 +0900 @@ -2,10 +2,13 @@ #include <stdlib.h> #include "CellTaskListInfo.h" +#define NEXT_ADDR(addr, size) \ + (TaskListPtr)((int)(addr) + (size)) + int CellTaskListInfo::extend_pool(int num) { - TaskListPtr q = NULL, p; + TaskListPtr q = NULL; int unit_size; unit_size = (ROUND_UP_ALIGN(sizeof(TaskList), 16)); @@ -19,9 +22,9 @@ taskListPool = q; /* Connect all free pack_list in the pool */ - q = NEXT_ADDR(taskListPool,unit_size); // q = taskListPool + 1; - for (; --num > 0; q = NEXT_ADDR(q + unit_size)) { - q->naext = NEXT_ADDR(q, unit_size); // q->next = q + 1; + q = NEXT_ADDR(taskListPool, unit_size); // q = taskListPool + 1; + for (; --num > 0; q = NEXT_ADDR(q, unit_size)) { + q->next = NEXT_ADDR(q, unit_size); // q->next = q + 1; } q->next = freeTaskList; freeTaskList = NEXT_ADDR(taskListPool, unit_size);
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Sat Feb 16 19:57:23 2008 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Sat Feb 16 20:05:35 2008 +0900 @@ -9,7 +9,7 @@ { TaskManagerImpl::init(); - bufferManager = new CellBufferManager; + bufferManager = new CellBufferManager(); bufferManager->init(); }
--- a/TaskManager/Makefile.cell Sat Feb 16 19:57:23 2008 +0900 +++ b/TaskManager/Makefile.cell Sat Feb 16 20:05:35 2008 +0900 @@ -5,6 +5,7 @@ CELL_SPE_OBJS = $(CELL_SPE_SRCS:.cpp=.o) SPUCC = spu-g++ +SPUCFLAGS = -fno-strict-aliasing all: default default: $(TARGET) spe @@ -14,7 +15,7 @@ ar crus $@ $(ALL_OBJS) $(PPE_ALL_OBJS): %.o : %.cpp - $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + $(CC) $(CFLAGS) $(SPUCFLAGS) $(INCLUDE) -c $< -o $@ spe: $(CELL_SPE_OBJS)
--- a/include/TaskManager/task.h Sat Feb 16 19:57:23 2008 +0900 +++ b/include/TaskManager/task.h Sat Feb 16 20:05:35 2008 +0900 @@ -1,7 +1,7 @@ #ifndef INCLUDED_TASK #define INCLUDED_TASK -#define TASK_MAX_SIZE 200 +#define TASK_MAX_SIZE 30 typedef struct task_queue TaskQueue, *TaskQueuePtr; typedef struct htask HTask, *HTaskPtr;