changeset 188:06f39635a9b0

メモりリーク箇所発見:TaskManager/Test/test_render/ChangeLog参照
author gongo@localhost.localdomain
date Thu, 08 Jan 2009 15:34:19 +0900
parents ac52c139ad45
children 7c800a5570f1
files TaskManager/Cell/spe/SchedNop2Ready.cc TaskManager/Cell/spe/Scheduler.cc TaskManager/Makefile.def TaskManager/Test/test_render/ChangeLog TaskManager/Test/test_render/spe/DrawSpan.cpp TaskManager/Test/test_render/spe/DrawSpanRenew.cpp TaskManager/Test/test_render/task/DrawSpan.cpp TaskManager/Test/test_render/task/DrawSpanRenew.cpp
diffstat 8 files changed, 73 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/spe/SchedNop2Ready.cc	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Cell/spe/SchedNop2Ready.cc	Thu Jan 08 15:34:19 2009 +0900
@@ -30,7 +30,6 @@
 	
     // RenewTask 
     if (nextSched) {
-	printf("RenewTaskList start [SchedNop2Ready]\n");
 	return nextSched;
     } else {
 	scheduler->mail_write(MY_SPE_STATUS_READY);
--- a/TaskManager/Cell/spe/Scheduler.cc	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Cell/spe/Scheduler.cc	Thu Jan 08 15:34:19 2009 +0900
@@ -151,7 +151,7 @@
 	TaskListPtr list  = renewTop_taskList;
 	renewTop_taskList = renewTop_taskList->next;
 	renewCur_taskList = NULL;
-		
+
 	list->next = NULL;
 	SchedTaskList *sched
 	    = createSchedTaskList((uint32)list, this, SCHED_TASKLIST_RENEW);
--- a/TaskManager/Makefile.def	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Makefile.def	Thu Jan 08 15:34:19 2009 +0900
@@ -25,7 +25,7 @@
 IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cc=.o)
 
 CC     = g++   
-CFLAGS = -O9 -Wall `sdl-config --cflags` -g
+CFLAGS = -O0 -Wall `sdl-config --cflags` -g
 LIBS   = 
 
 INCLUDE = -I../include/TaskManager
\ No newline at end of file
--- a/TaskManager/Test/test_render/ChangeLog	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Test/test_render/ChangeLog	Thu Jan 08 15:34:19 2009 +0900
@@ -1,3 +1,18 @@
+2009-01-08  Wataru MIYAGUNI  <gongo@cr.ie.u-ryukyu.ac.jp>
+
+	* spe/DrawSpanRenew.cpp (DrawSpanRenew::run): fix
+	next_spack を free() していたが、do-while の最初で
+	next_spack = NULL とかやっている。
+	DrawSpan だと、free するのは free_spack ってやつなので
+	問題なかったが、なぜここは free(next_spack) とかやってるのか。
+	というわけで、next_spack,spack 両方用の
+	free_spack1, free_spack2 を生成して、これを free させることに。
+	これで、ようやくまともに動くようになった。けど微妙です。
+	遅いですね。
+
+	* addFile : DrawSpanRenew.cpp
+	DrawSpan の再起動 ver。
+
 2008-12-22  Wataru MIYAGUNI  <gongo@cr.ie.u-ryukyu.ac.jp>
 
 	* fix
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp	Thu Jan 08 15:34:19 2009 +0900
@@ -108,7 +108,7 @@
 	smanager->dma_load(tile->pixel, (uint32)addr,
 			   sizeof(uint32)*TEXTURE_BLOCK_SIZE, TEX_LOAD);
 	
-	smanager->dma_wait(TEX_LOAD);
+	//smanager->dma_wait(TEX_LOAD);
     }
 }
 
@@ -119,7 +119,7 @@
     uint32 end = (uint32)max_addr;
     uint32 length = end-start;
     uint32 diff = sizeof(uint32)*TEXTURE_BLOCK_SIZE;
-    uint32 max_tile = 8;
+    uint32 max_tile = 16;
     
     for (uint32 i = 0, j = 0; i <= length && j < max_tile; i += diff, j++) {
 	set_rgb((uint32*)(start + i));
@@ -171,7 +171,6 @@
     SpanPackPtr curr = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
     memcpy(curr, spack, sizeof(SpanPack));
     renew_task->add_param((int)curr);
-
     renew_task->add_param(cur_span_x);
 
     /**
@@ -283,12 +282,12 @@
 		     */
 		    if (!isAvailableTile(tex_addr)) {
 			spack->info.start = t;
-			set_rgb(tex_addr);
-			//set_rgbs(tex_addr,
-			//getTile(span->tex_width-1, tex_ypos,
-			//span->tex_width, span->tex_addr));
-			//reboot(spack, 0);
-			//goto FINISH;
+			//set_rgb(tex_addr);
+			set_rgbs(tex_addr,
+				 getTile(span->tex_width-1, tex_ypos,
+					 span->tex_width, span->tex_addr));
+			reboot(spack, 0);
+			goto FINISH;
 		    }
 
 		    rgb = get_rgb(tex_localx, tex_localy, tex_addr);
--- a/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Test/test_render/spe/DrawSpanRenew.cpp	Thu Jan 08 15:34:19 2009 +0900
@@ -42,11 +42,15 @@
 
     SpanPackPtr spack = (SpanPackPtr)smanager->get_param(3);
     SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
+    SpanPackPtr free_spack1 = spack;
+    SpanPackPtr free_spack2 = next_spack;
     Span *span;
     
     // span->length_x νǤκƵư
     int js_cont = smanager->get_param(4);
 
+    smanager->dma_wait(TEX_LOAD);
+
     do {
 	/**
 	 * SpanPack->next ¸ߤ硢
@@ -63,7 +67,7 @@
 	for (int t = spack->info.start; t < spack->info.size; t++) {	  
 	    span = &spack->span[t];
 
-	    Uint32 rgb = 0x00ff00;
+	    Uint32 rgb = 0x00ff0000;
 	    float tex1 = span->tex_x1;
 	    float tex2 = span->tex_x2;
 	    float tey1 = span->tex_y1;
@@ -114,10 +118,10 @@
 		     */
 		    if (!isAvailableTile(tex_addr)) {
 			spack->info.start = t;
-			set_rgb(tex_addr);
-			//set_rgbs(tex_addr,
-			//getTile(span->tex_width-1, tex_ypos,
-			//span->tex_width, span->tex_addr));
+			//set_rgb(tex_addr);
+			set_rgbs(tex_addr,
+				 getTile(span->tex_width-1, tex_ypos,
+					 span->tex_width, span->tex_addr));
 			//reboot(spack, 0);
 			//goto FINISH;
 		    }
@@ -159,13 +163,12 @@
 					   span->tex_width, span->tex_addr);
 			tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL;
 			tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL;
-			goto FINISH;
 			if (!isAvailableTile(tex_addr)) {
 			    spack->info.start = t;
-			    set_rgb(tex_addr);
-			    //set_rgbs(tex_addr,
-			    //getTile(span->tex_width-1, tex_ypos,
-			    //span->tex_width, span->tex_addr));
+			    //set_rgb(tex_addr);
+			    set_rgbs(tex_addr,
+				     getTile(span->tex_width-1, tex_ypos,
+					     span->tex_width, span->tex_addr));
 			    //reboot(spack, j);
 			    //goto FINISH;
 			}
@@ -188,12 +191,17 @@
 
 
 FINISH:
-    free(next_spack);
+    smanager->dma_wait(SPAN_PACK_LOAD);
+    //free(next_spack);
     free(linebuf);
     free(zRow);
 
     // Renew  allocate 줿ΤʤΤǡ free
-    free(spack);
+    //free(spack);
+
+    free(free_spack1);
+    free(free_spack2);
+
 
     return 0;
 }
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Test/test_render/task/DrawSpan.cpp	Thu Jan 08 15:34:19 2009 +0900
@@ -108,7 +108,7 @@
 	smanager->dma_load(tile->pixel, (uint32)addr,
 			   sizeof(uint32)*TEXTURE_BLOCK_SIZE, TEX_LOAD);
 	
-	smanager->dma_wait(TEX_LOAD);
+	//smanager->dma_wait(TEX_LOAD);
     }
 }
 
@@ -119,7 +119,7 @@
     uint32 end = (uint32)max_addr;
     uint32 length = end-start;
     uint32 diff = sizeof(uint32)*TEXTURE_BLOCK_SIZE;
-    uint32 max_tile = 8;
+    uint32 max_tile = 16;
     
     for (uint32 i = 0, j = 0; i <= length && j < max_tile; i += diff, j++) {
 	set_rgb((uint32*)(start + i));
@@ -171,7 +171,6 @@
     SpanPackPtr curr = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
     memcpy(curr, spack, sizeof(SpanPack));
     renew_task->add_param((int)curr);
-
     renew_task->add_param(cur_span_x);
 
     /**
@@ -283,12 +282,12 @@
 		     */
 		    if (!isAvailableTile(tex_addr)) {
 			spack->info.start = t;
-			set_rgb(tex_addr);
-			//set_rgbs(tex_addr,
-			//getTile(span->tex_width-1, tex_ypos,
-			//span->tex_width, span->tex_addr));
-			//reboot(spack, 0);
-			//goto FINISH;
+			//set_rgb(tex_addr);
+			set_rgbs(tex_addr,
+				 getTile(span->tex_width-1, tex_ypos,
+					 span->tex_width, span->tex_addr));
+			reboot(spack, 0);
+			goto FINISH;
 		    }
 
 		    rgb = get_rgb(tex_localx, tex_localy, tex_addr);
--- a/TaskManager/Test/test_render/task/DrawSpanRenew.cpp	Thu Jan 08 13:46:57 2009 +0900
+++ b/TaskManager/Test/test_render/task/DrawSpanRenew.cpp	Thu Jan 08 15:34:19 2009 +0900
@@ -42,11 +42,15 @@
 
     SpanPackPtr spack = (SpanPackPtr)smanager->get_param(3);
     SpanPackPtr next_spack = (SpanPackPtr)smanager->allocate(sizeof(SpanPack));
+    SpanPackPtr free_spack1 = spack;
+    SpanPackPtr free_spack2 = next_spack;
     Span *span;
     
     // span->length_x νǤκƵư
     int js_cont = smanager->get_param(4);
 
+    smanager->dma_wait(TEX_LOAD);
+
     do {
 	/**
 	 * SpanPack->next ¸ߤ硢
@@ -63,7 +67,7 @@
 	for (int t = spack->info.start; t < spack->info.size; t++) {	  
 	    span = &spack->span[t];
 
-	    Uint32 rgb = 0x00ff00;
+	    Uint32 rgb = 0x00ff0000;
 	    float tex1 = span->tex_x1;
 	    float tex2 = span->tex_x2;
 	    float tey1 = span->tex_y1;
@@ -114,10 +118,10 @@
 		     */
 		    if (!isAvailableTile(tex_addr)) {
 			spack->info.start = t;
-			set_rgb(tex_addr);
-			//set_rgbs(tex_addr,
-			//getTile(span->tex_width-1, tex_ypos,
-			//span->tex_width, span->tex_addr));
+			//set_rgb(tex_addr);
+			set_rgbs(tex_addr,
+				 getTile(span->tex_width-1, tex_ypos,
+					 span->tex_width, span->tex_addr));
 			//reboot(spack, 0);
 			//goto FINISH;
 		    }
@@ -159,13 +163,12 @@
 					   span->tex_width, span->tex_addr);
 			tex_localx = tex_xpos % TEXTURE_SPLIT_PIXEL;
 			tex_localy = tex_ypos % TEXTURE_SPLIT_PIXEL;
-
 			if (!isAvailableTile(tex_addr)) {
 			    spack->info.start = t;
-			    set_rgb(tex_addr);
-			    //set_rgbs(tex_addr,
-			    //getTile(span->tex_width-1, tex_ypos,
-			    //span->tex_width, span->tex_addr));
+			    //set_rgb(tex_addr);
+			    set_rgbs(tex_addr,
+				     getTile(span->tex_width-1, tex_ypos,
+					     span->tex_width, span->tex_addr));
 			    //reboot(spack, j);
 			    //goto FINISH;
 			}
@@ -188,12 +191,17 @@
 
 
 FINISH:
-    free(next_spack);
+    smanager->dma_wait(SPAN_PACK_LOAD);
+    //free(next_spack);
     free(linebuf);
     free(zRow);
 
     // Renew  allocate 줿ΤʤΤǡ free
-    free(spack);
+    //free(spack);
+
+    free(free_spack1);
+    free(free_spack2);
+
 
     return 0;
 }