diff Renderer/Engine/TextureHash.cc @ 1087:20f09564c586 draft

fix (not yet tested)
author root@localhost.localdomain
date Fri, 17 Dec 2010 18:34:29 +0900
parents 3bc98f6d31ff
children ee481853d5dd
line wrap: on
line diff
--- a/Renderer/Engine/TextureHash.cc	Fri Dec 17 12:59:08 2010 +0900
+++ b/Renderer/Engine/TextureHash.cc	Fri Dec 17 18:34:29 2010 +0900
@@ -6,8 +6,12 @@
 
 TextureHash::TextureHash(void)
 {
-    table = (hashtable*)malloc(sizeof(hashtable)*TABLE_SIZE);
-
+    int size = sizeof(hashtable)*TABLE_SIZE;
+#if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
+        table =  (hashtable*)malloc(size);
+#else
+        posix_memalign((void**)&table, alignment, size);
+#endif
     for (int i = 0; i < TABLE_SIZE; i++) {
         table[i].tx_id = -1;
         table[i].key = NULL;