30 #ifndef _CEGUIMemoryAllocatedObject_h_
31 #define _CEGUIMemoryAllocatedObject_h_
33 #ifndef _CEGUIMemoryAllocation_h_
34 # error Dont include this directly! Include CEGUIBase.h instead.
40 #ifdef CEGUI_CUSTOM_ALLOCATORS
50 template <
typename Class>
54 typedef typename AllocatorConfig<Class>::Allocator Allocator;
56 inline explicit AllocatedObject()
59 #ifndef CEGUI_CUSTOM_ALLOCATORS_DEBUG
60 inline void*
operator new(
size_t size)
62 return Allocator::allocateBytes(size);
65 inline void*
operator new(
size_t size,
const char* file,
int line,
const char* func)
67 return Allocator::allocateBytes(size, file, line, func);
71 inline void operator delete(
void* ptr)
73 Allocator::deallocateBytes(ptr);
76 #ifndef CEGUI_CUSTOM_ALLOCATORS_DEBUG
77 inline void*
operator new[] (
size_t size)
79 return Allocator::allocateBytes(size);
82 inline void*
operator new[] (
size_t size,
const char* file,
int line,
const char* func)
84 return Allocator::allocateBytes(size, file, line, func);
88 inline void operator delete[] (
void* ptr)
90 Allocator::deallocateBytes(ptr);
94 inline void*
operator new(
size_t size,
void* ptr)
100 inline void operator delete(
void* ptr,
void*)
102 Allocator::deallocateBytes(ptr);
109 template<
typename Allocator>
121 #endif // end of guard _CEGUIMemoryAllocatedObject_h_