29 #ifndef _CEGUIMemoryAllocatedObject_h_
30 #define _CEGUIMemoryAllocatedObject_h_
32 #ifndef _CEGUIMemoryAllocation_h_
33 # error Dont include this directly! Include CEGUIBase.h instead.
39 #ifdef CEGUI_CUSTOM_ALLOCATORS
49 template <
typename Class>
53 typedef typename AllocatorConfig<Class>::Allocator Allocator;
55 inline explicit AllocatedObject()
58 #ifndef CEGUI_CUSTOM_ALLOCATORS_DEBUG
59 inline void*
operator new(
size_t size)
61 return Allocator::allocateBytes(size);
64 inline void*
operator new(
size_t size,
const char* file,
int line,
const char* func)
66 return Allocator::allocateBytes(size, file, line, func);
70 inline void operator delete(
void* ptr)
72 Allocator::deallocateBytes(ptr);
75 #ifndef CEGUI_CUSTOM_ALLOCATORS_DEBUG
76 inline void*
operator new[] (
size_t size)
78 return Allocator::allocateBytes(size);
81 inline void*
operator new[] (
size_t size,
const char* file,
int line,
const char* func)
83 return Allocator::allocateBytes(size, file, line, func);
87 inline void operator delete[] (
void* ptr)
89 Allocator::deallocateBytes(ptr);
93 inline void*
operator new(
size_t size,
void* ptr)
99 inline void operator delete(
void* ptr,
void*)
101 Allocator::deallocateBytes(ptr);
108 template<
typename Allocator>
120 #endif // end of guard _CEGUIMemoryAllocatedObject_h_