CrossFramework Library
|
00001 00006 #if defined(XBASE_INCLUDED_IALLOCATOR_HPP) 00007 #else 00008 #define XBASE_INCLUDED_IALLOCATOR_HPP 00009 00010 //------------------------------------------------------------ 00011 #include <XBase/BuiltInTypes.hpp> 00012 00013 //------------------------------------------------------------ 00014 namespace XBase { 00016 00017 00018 class IAllocator 00019 { 00020 public: 00021 virtual ~IAllocator(); 00022 00024 00025 00030 static const pword_t DefaultAlignment = sizeof(pword_t); 00032 00034 00035 00039 static IAllocator& Default(); 00040 00047 static void SetDefault( IAllocator& aAllocator ); 00048 00052 static IAllocator& OperatorNewDelete(); 00054 00056 00057 00063 virtual ptr_t alloc( pword_t aSize , pword_t aAlignment = DefaultAlignment )=0; 00064 00069 virtual void free( ptr_t aPtr )=0; 00071 }; 00073 } 00074 //------------------------------------------------------------ 00075 #endif 00076 // EOF