"L. Spiro Engine"
|
00001 00018 #ifndef __LSTL_ALLOCATOR_H__ 00019 #define __LSTL_ALLOCATOR_H__ 00020 00021 #include "../LSTLib.h" 00022 #include "Allocators/LSAStdAllocator.h" 00023 #include "CriticalSection/LSHCriticalSection.h" 00024 00025 namespace lstl { 00026 00035 class CAllocator { 00036 public : 00037 // == Various constructors. 00038 LSE_CALL CAllocator(); 00039 virtual LSE_CALL ~CAllocator(); 00040 00041 00042 // == Functions. 00049 virtual LSVOID * LSE_CALL Alloc( LSUINTPTR _uiptrSize ); 00050 00060 virtual LSVOID * LSE_CALL ReAlloc( LSVOID * _pvAddr, LSUINTPTR _uiptrSize ); 00061 00067 virtual LSVOID LSE_CALL Free( LSVOID * _pvAddr ); 00068 00074 LSVOID LSE_CALL SetAllocator( CStdAllocator * _psaAllocator ); 00075 00081 CStdAllocator * LSE_CALL GetAllocator(); 00082 00088 const CStdAllocator * LSE_CALL GetAllocator() const; 00089 00094 LSVOID LSE_CALL Trash(); 00095 00096 00097 protected : 00098 // == Members. 00102 CStdAllocator * m_psaAllocator; 00103 00107 LSUINT32 m_ui32TotalAllocs; 00108 00114 static LSUINT32 m_ui32AllocCount; 00115 00120 static LSUINT32 m_ui32ObjCount; 00121 00125 static CCriticalSection * m_pcsCrit; 00126 00127 }; 00128 00129 } // namespace lstl 00130 00131 #endif // __LSTL_ALLOCATOR_H__