diff TaskManager/include/base.h @ 366:0251d06467de draft

rename include/TaskManager/* and add memory
author aaa
date Mon, 27 Jul 2009 15:51:18 +0900
parents include/TaskManager/base.h@7f991471d43f
children 94d82f2c842f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TaskManager/include/base.h	Mon Jul 27 15:51:18 2009 +0900
@@ -0,0 +1,28 @@
+#ifndef INCLUDED_BASE_H_
+
+#include <new>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+#ifdef __SPU__
+//#if 0
+#  define BASE_NEW_DELETE(T)						\
+    /* override new/detele */                                           \
+    static void* operator new(size_t size) {                            \
+	if ((int)size == 0) {						\
+            size = 1;                                                   \
+	}                                                               \
+									\
+	void *ptr = malloc(size);					\
+	return ptr;							\
+    }                                                                   \
+    static void operator delete(void* rawMemory, size_t size) {         \
+	free(rawMemory);                                                \
+    }                                                                   \
+
+#else
+# define BASE_NEW_DELETE(T)
+#endif
+
+#endif