comparison 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
comparison
equal deleted inserted replaced
1086:ae5db88526f8 1087:20f09564c586
4 4
5 static int id_count; 5 static int id_count;
6 6
7 TextureHash::TextureHash(void) 7 TextureHash::TextureHash(void)
8 { 8 {
9 table = (hashtable*)malloc(sizeof(hashtable)*TABLE_SIZE); 9 int size = sizeof(hashtable)*TABLE_SIZE;
10 10 #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN)
11 table = (hashtable*)malloc(size);
12 #else
13 posix_memalign((void**)&table, alignment, size);
14 #endif
11 for (int i = 0; i < TABLE_SIZE; i++) { 15 for (int i = 0; i < TABLE_SIZE; i++) {
12 table[i].tx_id = -1; 16 table[i].tx_id = -1;
13 table[i].key = NULL; 17 table[i].key = NULL;
14 } 18 }
15 } 19 }