changeset 1133:bb17a03bab60 draft

fix.
author kaito@dolphins
date Wed, 16 Feb 2011 02:08:17 +0900
parents 4f16fad0dd09
children 80c1d74f2c7f f326494ffdc7
files Renderer/Engine/Makefile.cell Renderer/Engine/TextureHash.cc Renderer/Engine/polygon.h
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.cell	Tue Feb 15 19:21:03 2011 +0900
+++ b/Renderer/Engine/Makefile.cell	Wed Feb 16 02:08:17 2011 +0900
@@ -14,7 +14,7 @@
 
 LIBS += -lCellManager -lspe2 -lpthread
 
-CFLAGS += -D__CERIUM_CELL__ -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags`
+CFLAGS += -D__CERIUM_CELL__ -DHAS_POSIX_MEMALIGN -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags`
 LIBS   += `sdl-config --libs` -lSDL_image -lGL `xml2-config --libs`
 
 .SUFFIXES: .cc .o
--- a/Renderer/Engine/TextureHash.cc	Tue Feb 15 19:21:03 2011 +0900
+++ b/Renderer/Engine/TextureHash.cc	Wed Feb 16 02:08:17 2011 +0900
@@ -11,8 +11,9 @@
 #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
         table =  (hashtable*)malloc(size);
 #else
-        posix_memalign((void**)&table, alignment, size);
+        posix_memalign((void**)&table, 16, size);
 #endif
+
     for (int i = 0; i < TABLE_SIZE; i++) {
         table[i].tx_id = -1;
         table[i].key = NULL;
--- a/Renderer/Engine/polygon.h	Tue Feb 15 19:21:03 2011 +0900
+++ b/Renderer/Engine/polygon.h	Wed Feb 16 02:08:17 2011 +0900
@@ -44,8 +44,13 @@
       {
 	void *buff = 0;
 	if (size==0) return 0;
-	posix_memalign(&buff, 16, size);
+#if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
+	buff =  malloc(size);
+#else
+	posix_memalign(&buff, DEFAULT_ALIGNMENT, size);
+#endif
 	return buff;
+
       }
 
     void position_init(void);