Mercurial > hg > Members > kono > Cerium
annotate include/TaskManager/base.h @ 247:0098b5ff0d11
change example
author | aaa |
---|---|
date | Mon, 01 Jun 2009 19:33:09 +0900 |
parents | 102dad2949a0 |
children | bcb81858aa62 |
rev | line source |
---|---|
109 | 1 #include <new> |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 | |
5 | |
193 | 6 #ifdef __SPU__ |
7 //#if 0 | |
109 | 8 # define BASE_NEW_DELETE(T) \ |
9 /* override new/detele */ \ | |
10 static void* operator new(size_t size) { \ | |
11 if ((int)size == 0) { \ | |
12 size = 1; \ | |
13 } \ | |
14 \ | |
15 void *ptr = malloc(size); \ | |
16 return ptr; \ | |
17 } \ | |
18 static void operator delete(void* rawMemory, size_t size) { \ | |
19 free(rawMemory); \ | |
20 } \ | |
21 | |
22 #else | |
23 # define BASE_NEW_DELETE(T) | |
24 #endif | |
25 |