Mercurial > hg > Members > kono > Cerium
annotate TaskManager/include/base.h @ 805:daab9cd6f91f
merge
author | yutaka@localhost.localdomain |
---|---|
date | Fri, 21 May 2010 18:31:31 +0900 |
parents | 60aa3f241b10 |
children |
rev | line source |
---|---|
301
bcb81858aa62
remove deprecated source. not work.
tkaito@localhost.localdomain
parents:
193
diff
changeset
|
1 #ifndef INCLUDED_BASE_H_ |
bcb81858aa62
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
bcb81858aa62
remove deprecated source. not work.
tkaito@localhost.localdomain
parents:
193
diff
changeset
|
27 #endif |