"L. Spiro Engine"

F:/My Projects/LSEngine/Modules/LSMemLib/Src/Allocators/LSAStackAllocator.h

00001 
00021 #ifndef __LSA_STACKALLOCATOR_H__
00022 #define __LSA_STACKALLOCATOR_H__
00023 
00024 #include "../OSHeap/LSAOsHeap.h"
00025 
00026 namespace lsa {
00027 
00039         class CStackAllocator {
00040         public :
00041                 // == Various constructors.
00042                 LSE_CALLCTOR                                                    CStackAllocator();
00043                 LSE_CALLCTOR                                                    ~CStackAllocator();
00044 
00045 
00046                 // == Functions.
00054                 LSVOID * LSE_CALL                                                       Alloc( LSA_SIZE _sSize, LSUINT32 _ui32Align = 16UL );
00055 
00059                 LSVOID LSE_CALL                                                         Reset();
00060 
00061 
00062         protected :
00063                 // == Types.
00067                 typedef struct LSA_STACK {
00071                         LSUINT8 *                                                       pui8CurPos;
00072 
00076                         LSA_STACK *                                                     psNext;
00077 
00081                         LSA_SIZE                                                        sSize;
00082                 } * LPLSA_STACK, * const LPCLSA_STACK;
00083 
00084 
00085                 // == Members.
00089                 LSA_STACK *                                                             m_psHead;
00090 
00094                 LSA_STACK *                                                             m_psSearchStart;
00095 
00096 
00097                 // == Functions.
00104                 LSBOOL LSE_CALL                                                 AddStack( LSA_SIZE _sSize );
00105 
00106         };
00107 
00108 
00109         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00110         // DEFINITIONS
00111         // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00112         
00113 
00114 }       // namespace lsa
00115 
00116 #endif  // __LSA_STACKALLOCATOR_H__
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator