00001 /*00002 * Copyright 2006 Sony Computer Entertainment Inc.00003 *00004 * Licensed under the MIT Open Source License, for details please see license.txt or the website00005 * http://www.opensource.org/licenses/mit-license.php00006 *00007 */00008
00009 #ifndef __DAE_MEMORY_SYSTEM_H__00010 #define __DAE_MEMORY_SYSTEM_H__00011
00012 #include <dae/daeTypes.h>00013
00020class daeMemorySystem00021 {
00022 public:
00029 staticDLLSPECdaeRawRefalloc(daeString pool, size_t n);
00030
00036 staticDLLSPECvoiddealloc(daeString pool, daeRawRef mem);
00037 };
00038
00039 // (steveT) These new/delete overrides aren't complete. What about new[] and delete[]?00040 // Standard new should throw a bad_alloc exception, and a nothrow new should be provided00041 // that returns null instead of throwing bad_alloc. Because of these problems, plus the00042 // fact that we currently don't benefit in any way from overriding new and delete, this00043 // code is currently disabled.00044
00045 #if 000046 #define DAE_ALLOC \00047 /* Standard new/delete */ \
00048 inline void* operator new(size_t size) { return daeMemorySystem::alloc("meta", size); } \
00049 inline void operator delete(void* p) { daeMemorySystem::dealloc("meta", p); } \
00050 /* Placement new/delete */ \
00051 inline void* operator new(size_t, void* p) { return p; } \
00052 inline void operator delete(void*, void*) { }
00053 #endif00054
00055#define DAE_ALLOC00056
00057 #endif // __DAE_MEMORY_H__
colladadom
Author(s): Du Hung Hou, Khronos.org, Marcus Barnes, Greg Corson, Herbert Law, Sebastian Schwarz, Steven Thomas, John Hsu (ros package), Tim Field (ros package)
autogenerated on Fri Jan 11 09:24:25 2013