Mercurial > hg > Members > kono > Cerium
view TaskManager/include/base.h @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 60aa3f241b10 |
children |
line wrap: on
line source
#ifndef INCLUDED_BASE_H_ #include <new> #include <stdlib.h> #include <stdio.h> #ifdef __SPU__ # 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