annotate include/TaskManager/base.h @ 247:0098b5ff0d11

change example
author aaa
date Mon, 01 Jun 2009 19:33:09 +0900
parents 102dad2949a0
children bcb81858aa62
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
1 #include <new>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
2 #include <stdlib.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include <stdio.h>
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5
193
gongo@localhost.localdomain
parents: 161
diff changeset
6 #ifdef __SPU__
gongo@localhost.localdomain
parents: 161
diff changeset
7 //#if 0
109
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
8 # define BASE_NEW_DELETE(T) \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 /* override new/detele */ \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 static void* operator new(size_t size) { \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 if ((int)size == 0) { \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 size = 1; \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 } \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 void *ptr = malloc(size); \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 return ptr; \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 } \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 static void operator delete(void* rawMemory, size_t size) { \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 free(rawMemory); \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 } \
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22 #else
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 # define BASE_NEW_DELETE(T)
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 #endif
5c194c71eca8 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25