15 static inline void* allocate(
size_t count) {
16 void* ptr =
new unsigned char[count];
20 static inline void deallocate(
void* ptr) {
21 delete[] ((
unsigned char*) ptr);
25 template<
class AllocatorClass>
34 inline void*
operator new(
size_t size) {
35 return AllocatorClass::allocate(size);
38 inline void*
operator new(size_t,
void* ptr) {
42 inline void*
operator new[](
size_t size) {
43 return AllocatorClass::allocate(size);
46 inline void operator delete(
void* ptr) {
47 AllocatorClass::deallocate(ptr);
50 inline void operator delete(
void* ptr,
void*) {
51 AllocatorClass::deallocate(ptr);
54 inline void operator delete[](
void* ptr) {
55 AllocatorClass::deallocate(ptr);
63 #ifndef AI_ALLOCATOR_CLASS
64 #define AI_ALLOCATOR_CLASS _DefaultAllocator
69 typedef _MemObject<AI_ALLOCATOR_CLASS> MemObject;
Definition: MemoryAllocator.h:26
Definition: MemoryAllocator.h:10