Mercurial > hg > Game > Cerium
annotate TaskManager/include/base.h @ 639:91d03774c407 draft
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 94d82f2c842f |
children |
rev | line source |
---|---|
301
7f991471d43f
remove deprecated source. not work.
tkaito@localhost.localdomain
parents:
193
diff
changeset
|
1 #ifndef INCLUDED_BASE_H_ |
7f991471d43f
remove deprecated source. not work.
tkaito@localhost.localdomain
parents:
193
diff
changeset
|
2 |
109 | 3 #include <new> |
4 #include <stdlib.h> | |
5 #include <stdio.h> | |
6 | |
7 | |
193 | 8 #ifdef __SPU__ |
109 | 9 # define BASE_NEW_DELETE(T) \ |
10 /* override new/detele */ \ | |
11 static void* operator new(size_t size) { \ | |
12 if ((int)size == 0) { \ | |
13 size = 1; \ | |
14 } \ | |
15 \ | |
16 void *ptr = malloc(size); \ | |
17 return ptr; \ | |
18 } \ | |
19 static void operator delete(void* rawMemory, size_t size) { \ | |
20 free(rawMemory); \ | |
21 } \ | |
22 | |
23 #else | |
24 # define BASE_NEW_DELETE(T) | |
25 #endif | |
26 | |
301
7f991471d43f
remove deprecated source. not work.
tkaito@localhost.localdomain
parents:
193
diff
changeset
|
27 #endif |