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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
3 #include <new>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
4 #include <stdlib.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
5 #include <stdio.h>
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
6
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
7
193
gongo@localhost.localdomain
parents: 161
diff changeset
8 #ifdef __SPU__
109
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
9 # define BASE_NEW_DELETE(T) \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
10 /* override new/detele */ \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
11 static void* operator new(size_t size) { \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
12 if ((int)size == 0) { \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
13 size = 1; \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
14 } \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
15 \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
16 void *ptr = malloc(size); \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
17 return ptr; \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
18 } \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
19 static void operator delete(void* rawMemory, size_t size) { \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
20 free(rawMemory); \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
21 } \
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
22
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
23 #else
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
24 # define BASE_NEW_DELETE(T)
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
25 #endif
028ffc9c0375 Cerium cvs version
gongo@gendarme.local
parents:
diff changeset
26
301
7f991471d43f remove deprecated source. not work.
tkaito@localhost.localdomain
parents: 193
diff changeset
27 #endif