changeset 2033:3494884963a5 draft

merge
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 16 Dec 2014 15:54:24 +0900
parents dae9dc8d1d8f (current diff) f7969d7f5605 (diff)
children ce7a3887d09b
files
diffstat 3 files changed, 41 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- 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 <typename T> class Queue : T {
-public:
+ public:
 
     T();
 
@@ -23,22 +23,22 @@
 
 template <typename T> 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<T>(){
-	queueInfoInit();
+        queueInfoInit();
     }
     /** 
-	normal constructor requires
+        normal constructor requires
     */
     QueueInfo<T>(QueueInfo<T> *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 @@
 template<typename T>void
 QueueInfo<T>::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.
+*/
 template<typename T>int
 QueueInfo<T>::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<T> は空にならない。最低1個は要素が入っていて
   1個目は特別扱いする。getFirst すると first->next を返す
- */
+*/
 
 /*!
   最初の1個は特別扱いなので、それの後に追加していく
- */
+*/
 template<typename T>void
 QueueInfo<T>::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 を返す。
- */
+*/
 
 template<typename T>T*
 QueueInfo<T>::poll()
 {
     T* e = first->next;
     if (e == this) {
-	return NULL;
+        return NULL;
     }
     remove(e);
     return e;
@@ -271,15 +271,15 @@
 /*!
   リスト内の指定された位置にある要素を返す。
   要素数を超えた位置を指定した場合 NULL を返す。
- */
+*/
 
 template<typename T>T*
 QueueInfo<T>::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;
 }
--- 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
--- 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