# HG changeset patch # User Yuhi TOMARI # Date 1418712864 -32400 # Node ID 3494884963a517069f5aeb020e9f87611765fa20 # Parent dae9dc8d1d8faa56c01a524b3110c9d98a2c5b50# Parent f7969d7f5605165aed677183cd0ee9a8079dcec6 merge diff -r dae9dc8d1d8f -r 3494884963a5 TaskManager/kernel/ppe/QueueInfo.h --- a/TaskManager/kernel/ppe/QueueInfo.h Tue Dec 16 15:53:39 2014 +0900 +++ b/TaskManager/kernel/ppe/QueueInfo.h Tue Dec 16 15:54:24 2014 +0900 @@ -6,7 +6,7 @@ #if 0 template class Queue : T { -public: + public: T(); @@ -23,22 +23,22 @@ template class QueueInfo : public T { -public: + public: /* constructor */ /** - singleton queuePool constructor - Do not use this as a Queue + singleton queuePool constructor + Do not use this as a Queue */ QueueInfo(){ - queueInfoInit(); + queueInfoInit(); } /** - normal constructor requires + normal constructor requires */ QueueInfo(QueueInfo *p) { - queueInfoInit(); - queuePool = p; + queueInfoInit(); + queuePool = p; } BASE_NEW_DELETE(QueueInfo); @@ -65,7 +65,7 @@ T* getNext(T* q) ; int length(); -private: + private: /* variables */ /* we cannot use static in template */ @@ -107,18 +107,18 @@ templatevoid QueueInfo::freePool() { for(T * p = queuePool->waiter; p; ) { - T * next = p->waiter; - p->waiter = NULL; - p->freeOnce(); - free(p); - p = next; + T * next = p->waiter; + p->waiter = NULL; + p->freeOnce(); + free(p); + p = next; } } /** - all pools are shared among QueueInfo (separated by size and type). - it automatically extended by 64. - */ + all pools are shared among QueueInfo (separated by size and type). + it automatically extended by 64. +*/ templateint QueueInfo::extend_pool(int num) { @@ -157,8 +157,8 @@ { T * q = queuePool->poll(); if (! q) { - queuePool->extend_pool(64); - q = queuePool->poll(); + queuePool->extend_pool(64); + q = queuePool->poll(); } q->init(); return q; @@ -176,11 +176,11 @@ /*! QueueInfo は空にならない。最低1個は要素が入っていて 1個目は特別扱いする。getFirst すると first->next を返す - */ +*/ /*! 最初の1個は特別扱いなので、それの後に追加していく - */ +*/ templatevoid QueueInfo::addFirst(T* e) { @@ -195,9 +195,9 @@ { #ifdef CHECK if (find(e)) { - fprintf(stderr,"Add duplicate task %0x\n",(int)e); - return; - // ... + fprintf(stderr,"Add duplicate task %0x\n",(int)e); + return; + // ... } #endif e->next = first; @@ -225,19 +225,19 @@ { #ifdef CHECK if (!find(e)) { - fprintf(stderr,"Remove non existing task %0x\n",(int)e); - return 0; - // ... + fprintf(stderr,"Remove non existing task %0x\n",(int)e); + return 0; + // ... } #endif e->prev->next = e->next; e->next->prev = e->prev; if (first->next == e) { - first->next = e->next; + first->next = e->next; } if (last == e) { - last = e->prev; + last = e->prev; } e->prev = NULL; @@ -248,14 +248,14 @@ /*! リストの先頭を取得および削除する。リストが空の場合は NULL を返す。 - */ +*/ templateT* QueueInfo::poll() { T* e = first->next; if (e == this) { - return NULL; + return NULL; } remove(e); return e; @@ -271,15 +271,15 @@ /*! リスト内の指定された位置にある要素を返す。 要素数を超えた位置を指定した場合 NULL を返す。 - */ +*/ templateT* QueueInfo::get(int index) { T* e = first->next; for (int i = 0; i < index; i++) { - if (e->next == this) return NULL; - e = e->next; + if (e->next == this) return NULL; + e = e->next; } return e; } @@ -289,9 +289,9 @@ { T* e = first->next; for(;;) { - if (e == this) return NULL; - if (e == task) break; - e = e->next; + if (e == this) return NULL; + if (e == task) break; + e = e->next; } return e; } diff -r dae9dc8d1d8f -r 3494884963a5 TaskManager/kernel/schedule/SchedTask.cc diff -r dae9dc8d1d8f -r 3494884963a5 TaskManager/kernel/schedule/SchedTask.h diff -r dae9dc8d1d8f -r 3494884963a5 example/word_count/Makefile.def --- a/example/word_count/Makefile.def Tue Dec 16 15:53:39 2014 +0900 +++ b/example/word_count/Makefile.def Tue Dec 16 15:54:24 2014 +0900 @@ -12,7 +12,7 @@ OPT = -g -O0 CC = clang++ -CFLAGS = -m64 -Wall $(OPT) +CFLAGS = -m64 -Wall $(OPT) INCLUDE = -I${CERIUM}/include/TaskManager -I. -I.. -LIBS = -L${CERIUM}/TaskManager +LIBS = -L${CERIUM}/TaskManager -lprofiler -ltcmalloc diff -r dae9dc8d1d8f -r 3494884963a5 example/word_count/Makefile.macosx --- a/example/word_count/Makefile.macosx Tue Dec 16 15:53:39 2014 +0900 +++ b/example/word_count/Makefile.macosx Tue Dec 16 15:54:24 2014 +0900 @@ -11,8 +11,8 @@ TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) TASK_OBJS = $(TASK_SRCS:.cc=.o) -LIBS += -lFifoManager `sdl-config --libs` -CC += -m$(ABIBIT) +LIBS += -lFifoManager `sdl-config --libs` -lprofiler +CC += -m$(ABIBIT) -g .SUFFIXES: .cc .o