Mercurial > hg > Game > Cerium
changeset 20:31a7ff27ee20
*** empty log message ***
author | gongo |
---|---|
date | Sun, 10 Feb 2008 13:46:26 +0900 |
parents | 98bb1b2bb71e |
children | b86782f881de |
files | TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/MailManager.cc TaskManager/Test/Sum/main.cpp TaskManager/kernel/ppe/SymTable.cc TaskManager/kernel/ppe/TaskInfo.cc TaskManager/kernel/ppe/TaskManager.cc include/TaskManager/FifoTaskInfo.h include/TaskManager/FifoTaskManagerImpl.h include/TaskManager/MailManager.h include/TaskManager/SymTable.h include/TaskManager/TaskInfo.h include/TaskManager/TaskManager.h |
diffstat | 12 files changed, 60 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Sun Feb 10 13:46:26 2008 +0900 @@ -4,6 +4,12 @@ #include "FifoTaskManagerImpl.h" #include "ppe_spe.h" +FifoTaskManagerImpl::~FifoTaskManagerImpl(void) +{ + delete taskInfo; + delete mailManager; +} + void FifoTaskManagerImpl::init(void) {
--- a/TaskManager/Fifo/MailManager.cc Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/Fifo/MailManager.cc Sun Feb 10 13:46:26 2008 +0900 @@ -8,6 +8,11 @@ freeMailQueue = NULL; } +MailManager::~MailManager(void) +{ + destroy_mailQueue(); +} + int MailManager::init_pool_mailQueue(int num) { @@ -71,6 +76,18 @@ } +void +MailManager::destroy_mailQueue(void) +{ + MailQueuePtr q; + + for (q = mailQueuePool; q; q = q->next) { + free(q); + } + freeMailQueue = mailQueuePool = NULL; +} + + MailQueuePtr append_mailQueue(MailQueuePtr list, MailQueuePtr q) {
--- a/TaskManager/Test/Sum/main.cpp Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/Test/Sum/main.cpp Sun Feb 10 13:46:26 2008 +0900 @@ -140,5 +140,8 @@ manager->set_init_task("Init"); manager->run(); + manager->finish(); + delete manager; + return 0; }
--- a/TaskManager/kernel/ppe/SymTable.cc Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/kernel/ppe/SymTable.cc Sun Feb 10 13:46:26 2008 +0900 @@ -1,6 +1,18 @@ #include <string.h> #include "SymTable.h" +SymTable::~SymTable(void) +{ + SymTbPtr tb; + + for (int i = 0; i < symtb_index; i++) { + tb = &symtb[i]; + delete [] tb->sym; + } + + delete [] symtb; +} + void SymTable::init(void) {
--- a/TaskManager/kernel/ppe/TaskInfo.cc Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskInfo.cc Sun Feb 10 13:46:26 2008 +0900 @@ -18,6 +18,11 @@ freeTask = NULL; } +TaskInfo::~TaskInfo(void) +{ + finish(); +} + void TaskInfo::init(void) {
--- a/TaskManager/kernel/ppe/TaskManager.cc Sun Feb 10 13:23:29 2008 +0900 +++ b/TaskManager/kernel/ppe/TaskManager.cc Sun Feb 10 13:46:26 2008 +0900 @@ -34,6 +34,13 @@ symtb->init(); } +void +TaskManager::finish(void) +{ + delete m_impl; + delete symtb; +} + /** * @param command Task executes method number * @param in_size Size of data
--- a/include/TaskManager/FifoTaskInfo.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/FifoTaskInfo.h Sun Feb 10 13:46:26 2008 +0900 @@ -7,6 +7,7 @@ class FifoTaskInfo : public TaskInfo { public: + /* function */ int extend_pool_taskList(int num); TaskListPtr get_available_taskList(void);
--- a/include/TaskManager/FifoTaskManagerImpl.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/FifoTaskManagerImpl.h Sun Feb 10 13:46:26 2008 +0900 @@ -15,6 +15,9 @@ class FifoTaskManagerImpl : public TaskManagerImpl { public: + /* constructor */ + ~FifoTaskManagerImpl(void); + /* functions */ void init(void); void run(void);
--- a/include/TaskManager/MailManager.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/MailManager.h Sun Feb 10 13:46:26 2008 +0900 @@ -10,6 +10,7 @@ public: /* constructor */ MailManager(void); + ~MailManager(void); /* functions */ int init_pool_mailQueue(int num); @@ -17,6 +18,7 @@ MailQueuePtr create_mail(unsigned int data); MailQueuePtr get_free_mailQueue(unsigned int data); void free_mailQueue(MailQueuePtr q); + void destroy_mailQueue(void); private: /* variables */
--- a/include/TaskManager/SymTable.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/SymTable.h Sun Feb 10 13:46:26 2008 +0900 @@ -10,6 +10,8 @@ class SymTable { public: + ~SymTable(void); + SymTbPtr symtb; int symtb_index;
--- a/include/TaskManager/TaskInfo.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/TaskInfo.h Sun Feb 10 13:46:26 2008 +0900 @@ -9,7 +9,7 @@ public: /* constructor */ TaskInfo(int num = 1); - virtual ~TaskInfo(void) {} + virtual ~TaskInfo(void); /* variables */ TaskListPtr taskListPool;
--- a/include/TaskManager/TaskManager.h Sun Feb 10 13:23:29 2008 +0900 +++ b/include/TaskManager/TaskManager.h Sun Feb 10 13:46:26 2008 +0900 @@ -20,6 +20,7 @@ /* functions */ void init(void); + void finish(void); HTaskPtr create_task(int cmd, int siz, unsigned long long in_addr, unsigned long long out_addr, void (*func)(void)); void set_task_depend(HTaskPtr master, HTaskPtr slave);